findstr /R *xyz filename.txt Search for text in all the files in a current directory Search for the occurrence of all words ending with ‘xyz’ in a file. Here the pattern can be specified using regular expressions. You can use regular expressions with findstr /R switch. C indicates that the search pattern has to be matched literally.įor example, to search for the string “Apple Ball Cat” in file Book.txt, the command would be as below findstr /C:"Apple Ball Cat" Book.txt Search with Regular Expressions Search for pattern with multiple words findstr /C:"word1 word2 word3." filename This command would print a line if it has has either the word ‘Apple’ or the word ‘Orange’ or both the words. Findstr "word1 word2 word3." filename.txt findstr "Apple Orange" fruits.txt
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |