Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Compare 3 files and print matches in Perl

by vinoth.ree (Monsignor)
on Oct 26, 2015 at 03:25 UTC ( [id://1145908]=note: print w/replies, xml ) Need Help??


in reply to Compare 3 files and print matches in Perl

Hi,

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

All is well. I learn by answering your questions...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1145908]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found