File compare/merge

Vladimir Panteleev vladimir at thecybershadow.net
Tue Apr 2 20:41:32 PDT 2013


On Tuesday, 2 April 2013 at 10:44:05 UTC, Stewart Gordon wrote:
> Nowadays, CSDiff, the compare feature in Notepad++, or good old 
> fc, depending on what is best for the circumstances.  At least 
> to compare - merging isn't something I've had to do much in my 
> time.
>
> Is anybody here writing a file-compare tool in D?  It would be 
> interesting to see how good a diffing algorithm we can come up 
> with. Maybe making use of levenshteinDistanceAndPath.

I once had to compare two very large (GBs in size) files 
(filesystem listings). Every diff program I tried crashed 
miserably. I wrote my own:
http://dump.thecybershadow.net/7558f727792723efdb159197e50d125f/uniqdiff.d

It's nothing fancy (no std.algorithm), and is greedy (it works on 
the assumption that once it finds one line that matches on both 
sides, then the diff chunk is over).


More information about the Digitalmars-d mailing list