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.
xchop is a C written function that acts as sort of a binary chop for strings.#!/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) }
Thanks Jim
In Section
Seekers of Perl Wisdom