简体   繁体   中英

Compare two txt files and print the difference line by line in txt file

I have two tab-delimited .txt files, and I want to compare them to each other. The end goal is to print the difference in a another .txt file, which will have only the lines where the different data in column occurs. Is it possible to do this with some script in Winodws?

There is no need to write a script for this manually, although it would be relatively easy to do in eg Python. You can install DiffUtils for Windows to get Linux style diff tools. You can then say (in a shell):

diff file1.txt file2.txt

WinMerge could possibly work for you. It has a command line interface, if you're looking to automate it. You can check the manual at http://manual.winmerge.org/Command_line.html . Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM