in reply to Comparing specific columns from 2 files

Assuming you need to compare only the three last fields of your input files and that these three fields define a unique key for comparison, you could:
  1. read file 1 and store the 3 fields of interest into a hash (the three fields concatenated as a key, with a value of, say, 1);
  2. close file 1;
  3. read file 2, grab the three fields and check if that key exists in the hash.
Update:

The following is Perl pseudo-code to do that:

my %hash; # first open file1 while (my $line1 = <$file1>) { my $key = join ";", (split /,/, $line1)[1..3]; $hash{$key} = 1; } close $file1; open my $file2, "<", "file2.txt" of die "could not open file2.txt $!"; while (my $line2 = <$file1>) { my $key = join ";", (split /,/, $line2)[1..3]; if (exists $hash{$key}) { # do something } else { # do something else } }