Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: multiple file reading

by wine (Scribe)
on Jul 09, 2001 at 16:09 UTC ( [id://94950]=note: print w/replies, xml ) Need Help??


in reply to multiple file reading

I know this is a Perl-forum but there is a very quick way to do this with uniq.

If the formats are exactly the same, you could use:

cat file1 file2 | uniq -u

to extract all lines that do not occur twice, i.e. when (tableA eq tableB && columnA eq columnB) fails.

All lines that do occur twice can be extracted with:

cat file1 file2 | uniq -d

If you're files differ in format like the use of spaces or something, consider using a filter

Note that this gives you no indication whether only the columns, or the tables or both didn't match. For that you have to user perl after all, I guess

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2024-04-25 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found