有人可以推荐一个好的(希望是免费的)命令行差异实用程序。我基本上需要从 .Net 启动它以生成某种文本文件,其中包含两个 xml 文件之间的差异。
谢谢!
您始终可以使用windows的fc文件比较工具中的构建,但虽然不是免费的,但我会推荐Beyond Compare。除了是一个非常好的图形差异工具外,它还可以在命令行中使用。
查看MSYS,它为您提供diff和 Windows 上所有常见的 GNU 实用程序。
正如其他人所说,您还可以通过安装Cygwin在 Windows 上获得diff和所有这些东西。
GNU utilities for Win32:
Plain text diff
don't always manage xml
nicely.
Here is an existing SO question that might help: XML Diff and Merge
好吧,Windows 已经附带了一个:FC.EXE 它可能不是最好的,但可能足以满足您的需要。
WinMerge always worked for me. On the other hand, if you want something lightweight extreme, ExamDiff is only one exe file. Neither of them are command line, though.
For that I would recommend just plain diff, in combination with, for example, vim and some plugin, depending on your preferences. Diff comes with unxutils, which someone already gave the link for (see above).
我知道这是一个旧线程,但 Microsoft 的 XML Diff and Patch Tool 非常适合您描述的用途:
http://msdn.microsoft.com/en-us/library/aa302294.aspx
重要的区别在于它是一个 XML 比较实用程序,而不是一个文本比较实用程序。如果节点或属性的顺序不同,文本差异实用程序将报告大量误报。
如果您下载示例代码,您可以构建 XmlDiffView,它可用于生成关于 xml 文件之间差异的漂亮 HTML 报告。
我用它来区分大量 app.config 和 web.config 文件,发现它很方便。