Hi, @rugabunda, @scott-sumner, @dinkumoil and All,
Ah, many thanks, Dinkumoil, for your optimization advices !
Of course, having 17,000 messages “impossible to open File-B.txt” is rather idiot ! I did not realize this, as working on my tiny File_A.txt :-(
Thus, appending 17,000 times, a line to File_C.txt is not very efficient, too, as you said !
Finally :
If you previously chose some basic filenames, without spaces, this syntax should be enough :
(for /f "delims=" %L in (File_A.txt) do @(findstr /x /c:"%L" File_B.txt 1>NUL 2>NUL || echo %L)) > File_C.txt
If your filenames may be long, with some space characters, the @dinkumoil solution, with the usebackq option and filenames surrounded by double quotes, is safer !
Cheers,
guy038