I want to make a batch which search a line in a text file and return true if the line is found or false if it's not.
This how I finf the line, but I don't know how to test it:
findstr /r /c:"^Process Status.*no errors, no warnings$" myfile.log
Can you help me on this please?
Thanks
findstr /r /c:"^Process Status.*no errors, no warnings$" myfile.log > nul
if errorlevel 1 (
echo The line was not found
) else (
echo The line was found
)
Check if the command sets errorlevel. If it is set, the text was not found.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With