比较两个txt文件并在txt文件中逐行打印差异
我有两个制表符分隔的 .txt 文件,我想将它们相互比较。最终目标是在另一个 .txt 文件中打印差异,该文件仅包含列中出现不同数据的行。是否可以使用 Winodws 中的一些脚本来做到这一点?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无需为此手动编写脚本,尽管在 Python 等中相对容易完成。您可以安装 DiffUtils for Windows 来获取 Linux 风格的 diff 工具。然后你可以(在 shell 中)说:
There is no need to write a script for this manually, although it would be relatively easy to do in e.g. Python. You can install DiffUtils for Windows to get Linux style diff tools. You can then say (in a shell):
WinMerge 可能适合您。如果您希望实现自动化,它有一个命令行界面。您可以在 http://manual.winmerge.org/Command_line.html 查看手册。希望这有帮助!
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!