I have a batch file with the following:
findstr "error" output > nul
if errorlevel 1 (
echo No errors found
) else (
echo Errors detected
)
However instead of “Errors detected” I’d like to learn how to print the line number and line text for every instance of a line with error. I have no idea how to begin to even do this so any help would be greatly appreciated.
Findstrcan display matching line numbers & the line itself with/n: