OK, this doesn't sound so difficult ... if possible I would read file2 completely into memory, already split up into a 2D array. So $file2[0][1], e.g. would be the 2nd field in line 1 of file2.
Having done that, proceed along the lines of the following (pseudo-)code:
# process file1 line by line while ($line = <FILE1>) { # split up the current line in file1 @fields = split /!/, $line; # for each line in the 2nd file foreach $lineref (@file2) { $number_of_matches = 0; # compare the two lines for $index (0..$number_of_fields) { $number_of_matches++ if ($lineref->[$index] eq $fields[$index]); } print "Matchinfo: ..."; } }
-- Hofmator
In reply to Re: Comparing fields in 1 database with fields in another
by Hofmator
in thread Comparing fields in 1 database with fields in another
by rline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |