China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 11:09
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Another case where comparing different text causes an error in the output View 715 Replies 3
Original Poster Posted 2008-08-17 02:47 ·  中国 广东 惠州 联通
初级用户
Credits 20
Posts 8
Joined 2008-08-16 18:27
17-year member
UID 123364
Gender Male
Status Offline
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.
Floor 2 Posted 2008-08-17 11:24 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 3 Posted 2008-08-18 15:10 ·  中国 广东 惠州 联通
初级用户
Credits 20
Posts 8
Joined 2008-08-16 18:27
17-year member
UID 123364
Gender Male
Status Offline
It does the same thing as typing a carriage return.
Floor 4 Posted 2008-08-18 18:04 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Didn't post #2 already say it?
echo.>>a.txt
Forum Jump: