in reply to [GOLF] Perl csv diff
As always with hashes, I can't promise anything about the order of the output, but that seems to be okay. :)#--------1---------2---------3---------4---------5---------6---------7 +---------8-------- #234567890123456789012345678901234567890123456789012345678901234567890 +123456789012345678 perl -anF, -le'$h{$F[0]}|=$^F;$^F-=eof}{"@_"=~/[12]$/&&print"$&:$`"whi +le(@_=each%h)' t1.csv t2.csv 1:8 1:6 2:1 2:3 2:5
#--------1---------2---------3---------4---------5---------6---------7 +------- #234567890123456789012345678901234567890123456789012345678901234567890 +1234567 perl -pe'@h{/([^,]*)/}|=2-@ARGV}while(@_=each%h){$_="@_"=~/[12]$/&&"$& +:$`$/"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [GOLF] Perl csv diff
by BrowserUk (Patriarch) on Nov 03, 2005 at 13:50 UTC |