7

Is there a program for windows that would do a great job of searching within files?

I have a folder that I constantly need to search in for certain text, It would be nice to have a program that caches the files and searches through them quickly, and keeps its cache updated.

I spend a lot of time searching with netbeans, notepad++ and etc, the problem is this is a folder on a network, so it opens every file each time and searches.

user893730
  • 1,207
  • 3
  • 18
  • 24
  • "so it opens every file each time and searches." - This will be true for any search tool that is not caching a copy of the files anyway. The tool **must** open the file to search it. – EBGreen Dec 22 '11 at 15:57
  • I suppose the user means, not opening the file every time a search is invoked. Otherwise I would have recommended `grep` ;) – tuergeist Dec 22 '11 at 16:56
  • Yeah I prefer something that stores a cache, but other than that, grep so far has had the best performance – user893730 Dec 22 '11 at 18:56

4 Answers4

8

I always use findstr, which is roughtly comparable to grep, but windows native.

Example:

findstr /s /i /m "MyClass" *.cpp

This will search recursively (/s) within the current folder. It will look into every file whose name matches *.cpp for the string MyClass.

/i ignores case

/m only print file names of matching files

You can open command line windows anywhere in windows by doing a right click while holding down shift anywhere on the free space in any folder. (Don't right click on files)

findstr will be noticably faster the second time you search within the same directory since windows caches opened files.

sinned
  • 489
  • 6
  • 20
4

You can use Windows Search it is available for Win XP up to Win 7. A more complete list of desktop search engines can be found at wikipedias site about desktop search engines

Edit: A good (probably the best) tool to find stuff in text files (w/o caches) is grep. (Refer to my comment to the question)

tuergeist
  • 320
  • 1
  • 5
1

Use glimpse / glimpseindex, as far as we are talking about ASCII textfiles here. It creates a very small index, since it does not store the line of occurence but only the fact that it occurs - so, a grep will be done, but only in the files actually containing the word, which is fast. Use glimpseindex
to index your harddrive, and use glimpse to search. the output is similar to grep. Easily adaptabe to emacs.

user65947
  • 11
  • 1
  • 1
    This is **not** an answer to the original question. Your solution is for Unix **not** Windows – DavidPostill Nov 13 '14 at 17:49
  • These days Microsoft supports running Linux tools on Windows with https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux and there are Windows builds too: https://github.com/glimpse-editor/Glimpse/releases/download/v0.2.0/glimpse-0.2.0-i686.msi – JohannesB Aug 27 '20 at 19:15
0

Use the find command. For example to find yourstring in all *.txt files:

C:\YourFolder\>find "yourstring" *.txt

If you're on a network, just map the drive to Z:\ for example, and run find from that drive.

KeyWeeUsr
  • 318
  • 5
  • 19
ModerateCarrot
  • 475
  • 4
  • 11