doc1.txt doc2.txt doc3.txt) in place of the directory. If you wish to search only specific files, you can list them on the command line individually (e.g. Any paths with spaces require double quotes ("") as normal. For instance, -L is not the same option as -l (lowercase L). Be aware, however, that unlike FINDSTR, grep options are typically case-sensitive. Suppress normal output (list files only, including full path).īoth FINDSTR and grep return full paths to a file, so you will likely need to do additional processing on the output of either. For your use case, you can try: grep -rilf C:\path\to\searchwords.txt C:\path\to\search > results.txt While grep implementations can vary in the options they support, GNUWin32 grep is a port of GNU grep (albeit currently v2.5.4 rather than v3.0) which can read search terms from a file. Note, however, FINDSTR has undocumented limits and bugs which may not make it a suitable option.įor a non-native solution, you might be interested in a port of the grep utility, such as GNUWin32 grep. Print only file names (which happens to include the full directory path). Use the search words as string literals (rather than regular expressions). For your use case, you could try: findstr /l /s /i /m /g:searchwords.txt /f:filestosearch.txt > results.txt For a native Windows solution, FINDSTR is a possible option.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |