如何忽略顺序合并/比较文件?
我有两个不同的属性文件,我需要找到差异。 第二个文件按键排序。
有没有可以帮助我的工具? 据我所知,每个合并工具都非常关心顺序。
I have two properties files that are not the same and I need to find the differences. The second file is sorted by key.
Is there a tool that can help me with it? From what I've seen every merge tool cares very much about the order.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 Linux 上的 bash 中通过对两个文件进行排序然后合并它们来完成此操作。 如果您使用的是 Windows,则可以安装 Cygwin 来运行 Linux 程序。
不过,我认为创建一个小程序来完成此操作是最好的选择,可能比学习使用 Cygwin 花费的时间更少。
编辑:您可以将其视为学习新技术的小项目。 我经常使用这样的项目来学习 Ruby 或 Python 之类的东西。 虽然如果是在工作中可能不会被接受。
I've done it in bash on Linux by sorting both files and then merge them. If you are on Windows you could install Cygwin for running Linux programs.
However, I think you are best served by creating a small program to do it, probably takes you less time than learning to use Cygwin.
Edit: You could look at it as a small project to learn a new technology. I often use projects like these to learn things like Ruby or Python. Although it may not be accepted if it is at work.
对一个或两个文件进行排序。
然后运行“diff”。
Sort one or both files.
Then run "diff".