This is a completely different problem—
The function of the above code is to find lines in _to_learn.txt that are not contained in _abandoned.txt.
Testing with _abandoned.txt:
and _learned.txt:
the result always leaves the last line
But if you add a carriage return to the last line of _learned.txt, that is:
then you can get the completely correct result, namely an empty text file _temp.txt.
findstr /beivg:_abandoned.txt _to_learn.txt>temp.txt
The function of the above code is to find lines in _to_learn.txt that are not contained in _abandoned.txt.
Testing with _abandoned.txt:
ee
ff
gg
hh
and _learned.txt:
ff
gg
hh
ee
the result always leaves the last line
ee
But if you add a carriage return to the last line of _learned.txt, that is:
ff
gg
hh
ee
then you can get the completely correct result, namely an empty text file _temp.txt.

