I have two text files: Last_RUN_Result.txt has:
AAAA
BBBB
The New_RUN_Result.txt has:
AAAA
CCCC
I need a Compare_Result.txt has:
AAAA
So I used the script as below:
REM Search New_RUN_Result.txt's instance name in Last_RUN_Result.txt
rem DEL Compare_Result.txt
echo. 2>Compare_Result.txt
for /F "tokens=1 delims= " %%j in (New_RUN_Result.txt) do (
FIND /c "%%j" Last_RUN_Result.txt
IF %ERRORLEVEL% EQU 0 (
echo.%%j >> Compare_Result.txt
)
)
But I will get:
AAAA
CCCC
Could you please help me out of this? Thank you for your time:)