[英]Compare 2 text files and display the difference between them (PowerShell or CMD)
I have 2 text files text1.txt
contains:我有 2 个文本文件
text1.txt
包含:
fc1/1 storage
fc1/5 switch
fc1/7 replication
text2.txt
contains: text2.txt
包含:
fc1/1 storage
fc1/5 nas
fc1/7 replication
I want a script that compares the 2 text files and generate text found on text2.txt
but not on text1.txt
in a text file named difference.txt
我想要一个脚本来比较 2 个文本文件并生成在
text2.txt
但不在text1.txt
上的文本文件中的名为difference.txt
的文本
difference.txt
contains difference.txt
.txt包含
fc1/5 nas
any ideas?有任何想法吗?
Maybe ...也许 ...
findstr /v /g:text1.txt text2.txt > difference.txt
Search text2.txt
for lines not matching ( /v
) lines in text1.txt
搜索
text2.txt
不匹配(线/v
中)线text1.txt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.