Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: combining 2 files with a comon field

by jhourcle (Prior)
on May 18, 2005 at 13:57 UTC ( [id://458207]=note: print w/replies, xml ) Need Help??


in reply to Re: combining 2 files with a comon field
in thread combining 2 files with a comon field

If we're going with that assumption (same number of lines, and the keys are in the same order), then it's a one liner in unix shell:

paste  -d\| file1 file2 | cut -d\| -f1,2,5- > file3

I think I prefer jmcnamara's solution with join, though, as it's more forgiving of bad input.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://458207]
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