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

Re^2: Merge 2 files using key field

by Jalcock501 (Sexton)
on Nov 11, 2013 at 09:15 UTC ( #1061962=note: print w/ replies, xml ) Need Help??


in reply to Re: Merge 2 files using key field
in thread Merge 2 files using key field

Hi Marinersk

I've managed to solve this now using awk instead. I know its not perl but for those interested here is how I did it.

#!/usr/gnu/bin/gawk -f BEGIN { OFS=FS="," } { com="xchop -d, group.csv " $1 while ((com |getline res) > 0) { if (split(res,arr) > 1) print $2,arr[2] } close(com) }
xchop is a C written function that acts as sort of a binary chop for strings.

Thanks Jim


Comment on Re^2: Merge 2 files using key field
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-12-22 23:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls