I'm looking for an application that works like a blink comparator - not for astronomical images, but for text files.
I have recently had to work with pairs of output files that are (or rather look) nearly identical, trying to find the differences. Using diff isn't practical - it tends to find enormous blocks of irrelevant differences, somehow. So I have come up with an idea inspired by the blink comparator, that works rather well:
I open the two files in vi, in two tabs in konsole (the KDE xterm), and skip back and forth quickly between the two tabs. The parts of the text that are the same seem to stand still, but the differences show up as movement - this is surprisingly efficient.
The only 'problem' is that I have to change between Ctl-PageUp/Ctl-PgDn (for changing the tab) and using PgDn in between to move down through the two files, something that can easily get confused. I can't imagine I'm the first one to have had this idea (apart from the guy who invented the original in 1904), so perhaps a piece of software got written?
Edit
The files I'm looking at are putput from SQL queries; I'm transferring some very large tables from MySQL to Redshift (an AWS database based on PostgreSQL 8), and I run some queries that sum up stuff per day, for eaxmple, and compare the output after sanitising it a bit - things like removing |
from the start and end of lines in the MySQL output other things that are easily done with sed
. It often doesn't work well with diff
, because eg a space at the end of lines, and rather than chasing down the reason (which can be difficult, since it isn't visible), visually comparing the files seems like an attractive solution.
I overcome the problem with 'insertions' - ie. when lines are missing from one files - by noting down the gap and then realigning the texts by scrolling up as appropriate until the match again. It isn't perfect, but it doesn't actually have to be.
diff
style options. – Paul_Pedant Jan 20 '22 at 18:41diff
do all the heavy lifting, and parse its report to drive the visual presentation. – Paul_Pedant Jan 21 '22 at 13:12diff -b -Z --strip-trailing-cr
might help. Until we understand why diff outputs spurious lines, we cannot really know how to improve on it. Some raw data on pastebin would help, if you can hide the confidential content withtr 'A-Za-z' 'x'
. I have the ideas to handle the comparisons, vertical and horizontal gaps, and presentation.diff_blink
is my Project of the Month (or maybe Year) ! – Paul_Pedant Jan 22 '22 at 15:24