I have a windows batch script that will look for a string within a file
find /i "WD6" %Inputpath%file.txt
if %errorlevel% == 0 GOTO somestuff
Currently this is what my code looks like. I've come across a new string I want to search for in the same file and do the same action if it finds it, it stored it in a variable called %acctg_cyc%
can I search for both strings in one line of code? I tried this:
find /i "WD6" %acctg_cyc% %Inputpath%file.txt
if %errorlevel% == 0 GOTO somestuff
But it seems to ignore the %acctg_cyc% and only look for "WD6" in file.txt. I tried testing where %acctg_cyc%
is in file.txt and when it is not and it passes both times.
Any thoughts? I know I could do this in more lines of code but I'm really trying to avoid that right now. Maybe it's just not possible.
Thank you for any help!
find "word1" file.txt|find "word2"
does not appear to be working. – Wore