in reply to Re^2: compare data between two files using Perl
in thread compare data between two files using Perl

I think I understand what you are trying to do, and the approach I gave is a good start for conducting the analysis you want to perform.

Suppose that the first file contains the following triples:

RefDes Package PType R1 P1 T1 R2 P2 T2 ...
and the second file contains
RefDes Package PType R1 P1 NOT-T1 R2 P2 T2 R2 P2 ANOTHER-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.

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.