Search for EXACT word using a Batch file - Help!
Posted: 29 Apr 2017 12:49
I have a folder with one hundred and some htmls.I want to find an exact match to any complete word I search for and display it in a text file.The latest attempt still failed:
for %%f in (*.html) do findstr /m /p /c:"cop.rar" "%%f" >> exact-results.txt
What the above only does is shows the results of the name.html files that the word cop is in.
Examples it found: 69cop.rar , 75cop.rar , lastcop.rar , anothernamecop.rar
No good....what I want is the EXACT word only that I search for.
If I search for cop.rar , I only want the name of the html(s) that cop.rar would be in.Thanks for your help!
Val
for %%f in (*.html) do findstr /m /p /c:"cop.rar" "%%f" >> exact-results.txt
What the above only does is shows the results of the name.html files that the word cop is in.
Examples it found: 69cop.rar , 75cop.rar , lastcop.rar , anothernamecop.rar
No good....what I want is the EXACT word only that I search for.
If I search for cop.rar , I only want the name of the html(s) that cop.rar would be in.Thanks for your help!
Val