0

Is there a way/tool to show differences between two files side by side only highlighting differences in a similar way kdiff3 does that but with a tool that is reasonably fast?A similar question was asked here almost 6 years ago but no useful answers given. Even better a tool that understands data structure such as csv? I often deal with data files that might differ in a single column by a sign only or format of the number and for this purpose diff is quite useless. kdiff3 shows the data like this: enter image description here

Which immediately tells you what is different between the data files. It not only shows you that the whole line is different but also what is different. But, kdiff3 is insanely inefficient, comparing 2 17 MB files takes 10 minutes which is beyond ridiculous. (I once tried something called total commander on windows which has this function and its comparing efficiency blew my mind). Being aware of data structure and showing only the different fields would be a huge advantage but all csv comparators that I found cannot deal with a situation that one of the files has different number of columns (say you add a column to your data) and they can only compare the same structure and so i am good with the kdiff3 or total commander style approach. I tried vimdiff --- says it cannot run diff on the files, meld --- slow and in the end does nothing, icdiff -- slow, etc.

Just as comparison and an illustration what i am looking for, i reached to a virtual machine compared the same two files with total commander (over network connection) and in 2 seconds (compared to 10 minutes of kdiff3 on local ssd), i got: enter image description here

atapaka
  • 541

2 Answers2

0

kdiff3 hasn't seen an update in 10 years¹; I don't think you really want to be using that; if that style of UI is what you're after, meld is probably more what you want. Anyways, you already tried that; I really can't reproduce the slowness, I tried with two similarly sized files with around 1500 changes, and it takes about 12 s to give the comparison you need. So, maybe your versions of these softwares are just really really old? I can't reproduce your level of slowness, even when I run at a high niceness level with stress utilizing all my CPU cores.

If you primarily need fast: try (works outside of git repos!) git diff --word-diff=color fileA.txt fileB.txt.

Regarding structure:

Maybe you'd actually be best served with a tool that does not try to compare the two text files line-by-line, but with a tool that simply reads both CSVs and just outputs the differing records. But that would go into (short, but) very application-specific scripting, and would leave the scope of your question.


¹ it's being continued as part of KDE Gear, but your screenshot doesn't look like that.

0

Have you looked at delta? It's quite closely coupled to git, but it can also be used to compare files outside of git.

Popup
  • 516