我如何比较两个文本文件?(How I can compare two text files?)
我保存了两个.txt(Ej:File1.txt,File2.txt)我应该如何比较特定行的文本:
( echo echo example echo echo example echo echo example ) > File1.txt ( echo echo example echo echo example echo echo file example ) > File2.txt在这种情况下返回false,因为第3行不相等。
I saved two .txt (Ej: File1.txt, File2.txt) How should I compare the text for an specific line:
( echo echo example echo echo example echo echo example ) > File1.txt ( echo echo example echo echo example echo echo file example ) > File2.txtReturn in this case false because the line 3 its not equal.
最满意答案
fc file1.txt file2.txt>nul if errorlevel 1 (echo different) else (echo same)基本的。 运行fc以压缩文件,并抑制输出。 errorlevel建立= 0如果相同,否则不同。
fc file1.txt file2.txt>nul if errorlevel 1 (echo different) else (echo same)fundamental. run fc to compre the files, and suppress output. errorlevel is established =0 if same, else different.
更多推荐
发布评论