We help IT Professionals succeed at work.
Private
Troubleshooting Question

How to search for specific word within files of a folder in Win7.

57 Views
Last Modified: 2020-10-15
Hi Experts,

How do I search for specific word within files of a folder in Win7.
Tried following didn't work.
How to Search for words within files on Windows 7
  1. Open windows explorer.
  2. Using the left hand file menu select the folder to search in.
  3. Find the search box in the top right hand corner of the explorer window.
  4. In the search box type content: followed by the word or phrase you are searching for.(eg content:yourword)

See attached.
Untitled.png

Thanks
Comment
Watch Question

NVITEnd-user support
CERTIFIED EXPERT

Commented:
Work fine here, even with my "Windows Search" service off.

Why does your image show in the Address field: "Search results in P"?
CERTIFIED EXPERT

Author

Commented:
Hi,

Why does your image show in the Address field: "Search results in P"?
Thats the name of the folder I'm looking for...(C:\P)
 
Technical Support Specialist
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
you did select the OS (C:) drive in the right hand column
Hello ThereSystem Administrator
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
This is my list of search tools better than Windows Search.
DTSearch - http://www.dtsearch.com/
Agent Ransack - https://www.mythicsoft.com/agentransack/
Directory Opus - https://www.gpsoft.com.au/
X1 Search - https://www.x1.com/products/x1-search/ 
Sudeep SharmaTechnical Designer
CERTIFIED EXPERT

Commented:
Did you tried checking the option to look for file content from the Advance Search Option?

Image below for details:




Thanks,
Sudeep
CERTIFIED EXPERT

Author

Commented:
Hi Experts,


findstr "11527203" c:\P\*.* 
This works.
How can I have the output copied into memory?
Also if possible to just extract the file names where the text exists (not the entire line where text was found) would be great.
you did select the OS (C:) drive in the right hand column
I did select the P folder, however as soon I click on search it shows as posted.
 list of search tools better than Windows Search.
Do not use it that often, would prefer not install anything if dont have to.
Did you tried checking the option to look for file content from the Advance Search Option?
Yes, I did but not worked.

Thanks

NVITEnd-user support
CERTIFIED EXPERT

Commented:
Of course, findstr is limited, i.e. it may not work for xls*, doc* and pdf files.
CERTIFIED EXPERT

Author

Commented:
@NVIT,
I need it for CSV files and it seems to work.
Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
Adding /M should print out the file name I believe if it identifies a match

There’s probably a way to do that, sorry I’m not aware on the method nor best format for output copying though with findstr. Try one of these for the file name printing though — might work:

findstr /M /C:"11527203"  *.csv

findstr /M “11527203” “C:\P\*”

findstr /s /m /c:"11527203" *.*

Maybe another Expert on this thread can assist further if the above doesn’t fully work or is perhaps aware of how to output it.
CERTIFIED EXPERT

Author

Commented:
The first two gave me errors.
Tried this but dont see what happened
findstr /s /m /c:\P "11527203" *.*
NVITEnd-user support
CERTIFIED EXPERT

Commented:
It should be like this:

findstr /s /m /c:"11527203" c:\p\*.csv

Open in new window


If you'd like to send the results to a file for later review... This sends it to CSVResults.txt in your TEMP folder:

findstr /s /m /c:"11527203" c:\p\*.csv>"%temp%\CSVResults.txt"

Open in new window

CERTIFIED EXPERT

Author

Commented:
It should be like this:

findstr /s /m /c:"11527203" c:\p\*.csv

This works, but how can I copy the results into memory (w/o creating a file)?

NVITEnd-user support
CERTIFIED EXPERT

Commented:
for /f "tokens=*" %a in ('findstr /s /m /c:"11527203" c:\p\*.csv') do (
  echo Do...
  echo ...whatever you want to do
  echo ...with %a
)

Open in new window

CERTIFIED EXPERT

Author

Commented:
Not sure how to follow.
All I want is the results of findstr /s /m /c:"11527203" c:\p\*.csv  copied into memory so I can open existing file and paste it there.
NVITEnd-user support
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Author

Commented:
Thank you experts!
NVITEnd-user support
CERTIFIED EXPERT

Commented:
Glad to help. Have a good one...
CERTIFIED EXPERT

Author

Commented:
Hi,

How can I add to this a date range criteria?

findstr /s /m /c:"11527203" c:\p\*.csv>"%temp%\CSVResults.txt"

Thanks
NVITEnd-user support
CERTIFIED EXPERT

Commented:
Date of the files?
CERTIFIED EXPERT

Author

Commented:
Yes, since folder is huge and its taking long time for the search, perhaps if I specify date range of files being created, for example only this month it may work faster.
CERTIFIED EXPERT

Author

Commented:
Also would like to add the date created next to the file name/s if possible (mm-dd-hh-nn).
if that's too complicate leave it for now.
Thanks

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.