I have two text files with the same number of newline terminated strings. The lines in the two files correspond to each other. The lines in each file individually might be repeated.
I would like to quickly identify which two lines differ and output either from the first file or from the second one.
this is a string this is another string empty string
this is A string this is another string Empty string
From perspective of file A, I would like to output first and third lines since they are different than in file B. Similarly for file B, I would output first and third lines of this files.
My standard approach to comparing files was to sort the two files and then use the
comm binary but sorting would destroy the correspondence between the two files. I also tried to get this done with
diff but it looks to be designed for a different task.
It would also be ok to output the two differing lines from both files with a tab separation.