in reply to Re^2: compare data between two files using Perl
in thread compare data between two files using Perl
Suppose that the first file contains the following triples:
and the second file containsRefDes Package PType R1 P1 T1 R2 P2 T2 ...
The above algorithm will report that R1,P1,T1 appears in the first file but the not second and that the triple R1,P1,NOT-T1 appears in the second file but not the first. The interpretation of this is that NOT-T1 in the second file is a mistake and should be T1. We can modify the code to actually produce this message, but I just wanted to demonstrate how this situation is picked up by the algorithm.RefDes Package PType R1 P1 NOT-T1 R2 P2 T2 R2 P2 ANOTHER-T2 ...
To take another example, consider the triples in each file that begin with R2,P2. The above algorithm will report that R2,P2,T2 appears in both files and that R2,P2,ANOTHER-T2 is in the second file but not the first. You have to decide how to interpret this situation. Perhaps it means that the second file is malformed because it contains two triples that begin with R2,P2.
Again, you should only need to read your files once.
|
|---|