http://qs321.pair.com?node_id=285385


in reply to Re: Re: File Comparison
in thread File Comparison

Sounds like an interesting problem, but I still can't quite picture the data and the result you want. These questions might clear things up for me:

Are the lines guaranteed to be unique?

Does the order of the lines matter as it does in diff?

If I see a line "XYZ" in file 1 and "XYZ" in file 2, and "XYZ" in file 3, are these the same line no matter where they show up in the respective files?

How big are the files? Would it be feasible to load them all into memory at the same time?

Is it ok to sort the files before doing the comparison or does your output need to be in a specific order?

Pretend letters are lines. What should be the output if the following are the contents of the three files?

file 1: A B C D E G file 2: B A D E G H file 3: A B D E G I

-- Eric Hammond