I have a log file with output of command in my batch file.
I want to review on this file and check if there were an error.
this is the row of this file with error:
9/20/2012 7:22:34 AM [Error] Error occured while reloading resource table: VALUE is duplicated
how I can to check it?
I try the following:
for /f "tokens=4 %%x in (%TMPLog%) do
if "%%x"=="ERROR" SET err=TRUE
but it doesn’t work.
You can have that much easier:
Another random note: For boolean variables I tend to have the pattern of the variable being defined when it’s true and not defined when it’s false. Then you can simply check it with
if defined errwhich reduces errors from mistyping the comparison value and also works properly in blocks without delayed expansion (another common source of mistakes). Just if you were wondering why I usedset err=1instead ofset err=TRUE.