My problem is to create a batch script file for Windows and iterate through a lot of files and find every file which has a line that contains two specified strings. So if the whole file contains those strings, that's not good enough, they should be at the same line.
For example, I have 5 files which contains the following:
1st: apple:green
2nd: apple
green
3rd: green
apple
4th: apple: yellowgreen
5th: apple: green
It should return the filenames of the first, fourth and fifth file.
Here is what I have:
FINDSTR /s /i /m "apple green" *.txt | FINDSTR "\MyDirectory" >> results.txt
How should I modify this to make it work?
findstr /i /s /m /r /c:"apple.*green" /c:"green.*apple" *.txt