Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Merge 2 files using key field

by marinersk (Curate)
on Nov 05, 2013 at 17:29 UTC ( #1061334=note: print w/ replies, xml ) Need Help??

in reply to Merge 2 files using key field

So, let's nudge this along in a more healthy direction.

Surely you have code that reads the files. Can you show that?

Comment on Re: Merge 2 files using key field
Replies are listed 'Best First'.
Re^2: Merge 2 files using key field
by Jalcock501 (Sexton) on Nov 11, 2013 at 09:15 UTC
    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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (14)
As of 2015-11-30 09:02 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (767 votes), past polls