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-04 09:05
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question about using findstr to compare text content View 936 Replies 1
Original Poster Posted 2007-04-28 04:45 ·  中国 北京 联通
初级用户
Credits 28
Posts 10
Joined 2007-04-25 04:51
19-year member
UID 86377
Gender Female
Status Offline
Using the batch file below, I want to output the different content in 1.txt and 2.txt to 3.txt
findstr /v /g:d:\1.txt 2.txt>3.txt

Where:
1.txt:
Chinese
morning
evening
2.txt:
Chinese
morning
eveningde

The result output to 3.txt is as follows:
Chinese
morning
eveningde

But if I add the letter a to the first three lines in both .txt documents (other letters work too), then the result in 3.txt is correct:
eveningde
Could some experts please explain why this is? Could it be that findstr can't compare lines that start directly with Chinese characters? Then if the text I want to compare starts with Chinese characters, what should I do?
Floor 2 Posted 2007-04-28 05:18 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
findstr /v /b /e /g:d:\1.txt 2.txt>3.txt
Exact match from beginning of line to end of line
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
lxmxn +2 2007-04-28 05:21
Forum Jump: