我有两个文件:content.txt
和remove.txt
。我想运行.cmd
脚本,删除content.txt
中的所有行。结果应该转到remove.txt
。
例如:result.txt
abc
1234
hello
qwerty
content.txt
abc
hello
def
remove.txt
1234
qwerty
这个问题是相同的,但是使用perl:Removing lines in one file that are present in another file。我只能使用标准的windows工具。
最佳答案
findstr /L /v /X /g:remove.txt content.txt>result.txt
/X表示“完全匹配线条”
?我的意思是“字面上-不是regex”
/v表示“不匹配”
/g:filename是用作字符串(排除)源的文件名
/我会对大小写不敏感。
关于windows - 如何删除Windows中另一个文本文件中存在的文本文件中的所有行?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35746578/