7

can some one recommend a good (hopefully free) command line diff utility. I would basically need to kick it off from .Net to produce some sort of a text file with the differences between two xml files.

Thanks!

Kara
  • 6,115
  • 16
  • 50
  • 57
Alex
  • 39,265
  • 21
  • 45
  • 42
  • I'd suggest some indication of which platform, aside from a casual reference to .Net in the second sentence of the question. – David Thornley Feb 12 '09 at 21:55

7 Answers7

9

You can always use the build in fc filecompare tool of windows but, although not free, I would recommend Beyond Compare. Besides being a very good graphical diff tool, it can be used from the command line too.

Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
  • if this is going to be integrated into an app, I don't think something like Beyond Compare would be a good choice (though it is a great graphical diff program). A small tool, or even better, a library, seems like the way to go. – rmeador Feb 12 '09 at 16:14
  • @rmeador, a library would indeed be better. The op asked for a command line utility though. – Lieven Keersmaekers Feb 12 '09 at 16:18
4

Check out MSYS, it gives you diff and all the common GNU utilities on Windows.

As somebody else stated, you can also get diff and all that stuff on Windows by installing Cygwin.

  • the most pertinent such utility being "diff". You can also get it through cygwin, which is my preferred approach. – rmeador Feb 12 '09 at 16:14
3

GNU utilities for Win32:

http://unxutils.sourceforge.net

tonys
  • 3,855
  • 33
  • 39
3

Plain text diff don't always manage xml nicely.

Here is an existing SO question that might help: XML Diff and Merge

Community
  • 1
  • 1
dmckee --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
2

I know this is an old thread, but Microsoft's XML Diff and Patch Tool works well for the use you describe:

http://msdn.microsoft.com/en-us/library/aa302294.aspx

The important difference is that it is an XML diffing utility rather than a text diff utility. Text diffing utilities will report a huge number of false positives if nodes or attributes are in a different order.

If you download the sample code, you can build XmlDiffView, which can be used to produce nice HTML reports of the differences between xml files.

I've used it to diff large numbers of app.config and web.config files, and found it handy.

kiprainey
  • 3,241
  • 4
  • 29
  • 29
2

Well, Windows already comes with one: FC.EXE It probably isn't the best that one can find, but may be it is good enough for what you need it for.

Timo
  • 1,088
  • 1
  • 10
  • 19
  • FC appears to be broken on windows 7 - it refuses to recognize a perfectly valid folder as such. – Johan Mar 17 '11 at 06:03
2

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

Rook
  • 60,248
  • 49
  • 165
  • 242