中国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-12 12:31
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How can a batch file compare two text files and output the lines that are different?
Printable Version  1,085 / 6
Floor1 adslcool Posted 2010-04-21 19:26
新手上路 Posts 10 Credits 10
Requirement: for lines that exist in A.txt, search through B.txt line by line, and then output the ones not found to 结果.txt


Example:
Contents of a.txt
___________________________________
aaa
bbb
vwh
ddd
eee
...
Thousands more lines omitted below
____________________________________


Contents of b.txt
____________________________________
000
aaa
q23
FFF
ggg
sdd
jjk
yyu
eee
...
Thousands more lines omitted below
____________________________________

Requirement: for lines that exist in A.txt, search through B.txt line by line, and then output the ones not found to 结果.txt




[ Last edited by adslcool on 2010-4-21 at 19:44 ]
Floor2 adslcool Posted 2010-04-21 19:27
新手上路 Posts 10 Credits 10
I need it urgently, handling thousands of records is really too hard
Floor3 Hanyeguxing Posted 2010-04-21 19:35
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Floor4 adslcool Posted 2010-04-21 19:39
新手上路 Posts 10 Credits 10
Requirement: for lines that exist in A.txt, search through B.txt line by line, and then output the ones not found to 结果.txt
Floor5 adslcool Posted 2010-04-21 19:46
新手上路 Posts 10 Credits 10
Floor6 Hanyeguxing Posted 2010-04-21 20:17
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂

Using a.txt as the sample for comparison, if the same line does not exist in b.txt then output it to c.txt
Floor7 Hanyeguxing Posted 2010-04-21 20:21
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂

Using a.txt as the sample for comparison, if the same line exists in b.txt then output it to c.txt
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023