I need to work with large files and must find differences between two. And I don\'t need the different bits, but the number of differences.
To find the number of dif
If you're dealing with files with analogous content that should be sorted the same line-for-line (like CSV files describing similar things) and you would e.g. want to find 2 differences in the following files:
File a: File b:
min,max min,max
1,5 2,5
3,4 3,4
-2,10 -1,1
you could implement it in Python like this:
different_lines = 0
with open(file1) as a, open(file2) as b:
for line in a:
other_line = b.readline()
if line != other_line:
different_lines += 1