我如何比较两个文本文件?(How I can compare two text files?)

编程入门 行业动态 更新时间:2024-10-27 13:34:54
我如何比较两个文本文件?(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.txt

Return 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.

更多推荐

本文发布于:2023-08-04 20:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1421374.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本文件   两个   compare   text   files

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!