中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-09 12:04
47,811 topics / 349,895 posts / today 0 new / 48,254 members
DOS批处理 & 脚本技术(批处理室) » Another case where comparing different text causes an error in the output
Printable Version  717 / 3
Floor1 Karman Posted 2008-08-17 02:47
初级用户 Posts 8 Credits 20
This is a completely different problem—

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.
Floor2 HAT Posted 2008-08-17 11:24
版主 Posts 5,017 Credits 9,023
Floor3 Karman Posted 2008-08-18 15:10
初级用户 Posts 8 Credits 20
It does the same thing as typing a carriage return.
Floor4 HAT Posted 2008-08-18 18:04
版主 Posts 5,017 Credits 9,023
Didn't post #2 already say it?
echo.>>a.txt
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023