How to search all text files in same folder for a keyword in Windows Vista

0

How do I search for a keyword in all the text files from a folder? I am using Vista.

Carlos Ribeiro

Posted 2009-09-28T07:19:54.350

Reputation:

Answers

4

%> findstr 'keyword' *.txt

akira

Posted 2009-09-28T07:19:54.350

Reputation: 52 754

1

In addition to the answers on this question,
I can also recommend Agent Ransack:

Agent Ransack is a free tool for finding files and information on your hard drive fast and efficiently. When searching the contents of files Agent Ransack displays the text found so you can quickly browse the results without having to separately open each file!

Agent Ransack provides compelling advantages over similar search tools:

  • Regular expressions that allow complex rule based searches.
  • Immediate contents results view.
  • Various wizards to walk the user through the searching process.

fretje

Posted 2009-09-28T07:19:54.350

Reputation: 10 524

1

Even better: Microsoft or Google Desktop Search (Free Software by M$ and Google).

They are able to index all sort of files (even pdf, doc, xls and that like).

So you can query the index instead of time-wasting searching with the con of having/building a large index and updating it.

Singularity

Posted 2009-09-28T07:19:54.350

Reputation: 41

0

To search files by file contents you must first enable it, since by default it's only enabled in indexed locations:

  • open any folder
  • menu Tools -> Folder Options
  • select tab Search, enable Always search file names and contents (might be slow)
  • press OK

To search:

  • go to the folder where you want to search
  • in search box type 'ext:txt keyword' (without quotes)

This will search for word keyword in all file names and contents in txt files. Keyword must be a separate word. To also include cases where keyword is part of a word (either in contents or file name) use wildcards like this

ext:c *keyword*

T. Kaltnekar

Posted 2009-09-28T07:19:54.350

Reputation: 7 636

0

The findstr may be extremely helpful, but the most powerful tool you're looking for here may be grep.

Joshua K

Posted 2009-09-28T07:19:54.350

Reputation: 771