I want to search in a text file for a specific string "Translation is SUCCESFUL" and if it exist I want an output results.txt with a text "SUCCES". If it is not exist I want an output results.txt with a text "FAIL".

Moderator: DosItHelp
Code: Select all
(findstr /C:"Translation is SUCCESFUL" Test.txt) >nul
if errorlevel 1 (
(echo FAIL)>"results.txt"
) else if errorlevel 0 (
(echo SUCCESS)>"results.txt"
) else (
(echo FAIL)>"results.txt"
)