Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search for a string in a folder.

Status
Not open for further replies.

dabiri

Technical User
Dec 8, 2014
33
US
Hi,
I'm trying to find a problem in a website's content. It involves a page that sends email. I have the folder that contains all the pages/contents. My problem is finding the file/page that contains the string "email". windows 7 will not let me use a search such as the one in Windows XP. is there a way to find this string in one of the 400+ files/pages in that directory without going into each file and searching for the string?

thanks.
 
As a matter of fact, you can.
In explorer, go to the directory you want to search and do a [Ctrl]+[F] for find, then put in the string you're looking for. After it finishes the file search, you may or may not a get a file listing, but there will be a button labeled "File contents". Click that to search within the files.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Pop up a cmd prompt, go to the directory. Type
Code:
findstr /s <string> <filename  template>
 
thanks.
pressing ctrl+F while on the folder, opens a dialog box that's already on the top right corner. but the option for "add a search filter" is greyed out.
the command findstr /s <string>
produces no results.
 
I personally cannot stand Windows 7 search. See the thread below which may offer a little help
thread779-1733504

Dave: I tried your exact steps, searching for a string in a folder with a bunch of text files (at least one of which contained the string). Not only did it not find it, but I did not see a "File Contents" button, so I'm not sure what you are referring to.

 
thanks.
I do not see a "file content" button to push.
 
I agree, I don't like windows search much. But rather than use some third party thing, whenever I need to do something I try to use the tools at hand. Also, my apologies if your explorer doesn't act the same as mine. But I attached a screen shot of what I see when I do a search for 'messages' in my 'temp' directory.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave: Ahh OK, a picture is worth a thousand words ... I figured out why you see that button and I don't; I guess a while ago I changed my search options (Tools, Folder Options, Search tab) to the "Always search file names and contents"... If you have the default option "In indexed locations, search contents but in non-indexed locations, don't search contents", then you see the File Contents button. But in my case, I didn't have to click any button, it was supposed to automatically search file contents... but it doesn't work for me!!!

search1_rvq9af.jpg
 
I have a little app that I wrote about 10 years ago in VB6 and it does exactly what you want: you point it to the folder you want to search, type the text, click the button and it lists all the files with that text in that folder. You can double-click on the item in the list and it opens it in Notepad. Simple and I use it often, and my co-workers like it, too.

You can have it
(if anybody can tell me how to send an EXE file to dabiri )

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
thank you all so much.
if you want, you can rename the .exe file as .txt (will look harmless to email clients) and then send it. i'm not sure if I can post my email here. the admin should decide. can I post my email?
 
Let me see if this will work.

You should find the attached file named Search.txt, donwnload it, rename it to Search.exe and try it.

Let me know if this wil work for you.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
 http://files.engineering.com/getfile.aspx?folder=268a1413-e09c-41b4-bf86-006b58841726&file=Search.txt
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top