I have two files (which could be up to 150,000 lines long; each line is 160 bytes), which I’d like to check to see if the lines in each are the same. diff won’t work for me (directly) because a small percentage of the lines occur in a different order in the two files. Typically, a pair of lines will be transposed.
What’s the best way to see if the same lines appear in both files, but where order doesn’t matter?
Thanks,
Chris
I have two files (which could be up to 150,000 lines long; each line
Share
Although it’s a slightly expensive way to do it (for anything larger I’d rethink this), I’d fire up python and do the following:
That’ll print the different lines if they differ.