7
1
I am looking to compare two text files. Normally, I can just use diff
to compare the two files to see the differences. This is great, except that I am more concerned with the percentage difference of the two files.
For example:
File A:
banana
TESTING
File B:
TESTING
In this case, the result would be a 50% difference. I've taken a look at wdiff
, and it mostly works, with the exception being that it looks at elements word-by-word (in fact, I can get the result above by doing wdiff -s filea fileb
).
Does a tool exist to provide file percentage difference on a by character/ by byte level?
Small correction, you shouldn't have a space after -u, otherwise diff thinks 0 is a file name (at least on linux). Should be
diff -u0 file1 file2
. – kristianp – 2020-02-16T21:51:50.0272diff -u 0 removes context – Lazy Badger – 2011-10-18T15:05:19.593