中国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-04 10:09
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Question about using findstr to compare text content
Printable Version  938 / 1
Floor1 merryheart0424 Posted 2007-04-28 04:45
初级用户 Posts 10 Credits 28
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?
Floor2 everest79 Posted 2007-04-28 05:18
金牌会员 Posts 1,127 Credits 2,564
findstr /v /b /e /g:d:\1.txt 2.txt>3.txt
Exact match from beginning of line to end of line
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023