I'm trying to write a bat script which will loop through a text file & search multiple different type of messages and assign variable to each type of message. The txt file may content 3 types of messages: Success, Error, & Fails.
Here is the condition: I may have a success & error at the same time in the file. So, if it found both of them, then set the status==error. If it found only success, set status==success; otherwise, if it found fails, set status==fails.
for /f "token=*" %%a IN (C:\testfile.txt) DO (
'FINDSTR /i /m "successfully loaded/unloaded" C:\testfile.txt if exist set %status%==Success',
'FINDSTR /i /m "Error" AND "successfully loaded/unloaded" C:\testfile.txt if exist set %status%==Error',
'FINDSTR /i /m "Fails" C:\testfile.txt if exist "Fails" set %status%==Fails'