in reply to Compare 3 files and print matches in Perl
If you files are sorted one, you can use linux command comm to find the common lines from all the three files,
comm -12 fileA fileB | comm -12 - fileC
-1 : suppress lines unique to FILE1
-2 : suppress lines unique to FILE2
-3 : suppress lines that appear in both files
|
|---|