Is it possible to search for a list of strings (100+), for example in a text file and using a command such as findstr to identify which files contain any of the strings? Or is there a better alternative (on Windows) ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Probably, from the findstr help I found:
/G:file Gets search strings from the specified file(/ stands for console).
and
/S Searches for matching files in the current directory and all
subdirectories.
so:
I created (with copy con brings me back) 3 files test.txt test1.txt and test2.txt and placed the strings we have from strings.txt into the respective files and then ran this command:
It indeed found them, and it even found all three from the source file strings.txt.