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

Re^2: Reading from text file

by jwkrahn (Abbot)
on Mar 23, 2018 at 06:27 UTC ( [id://1211590]=note: print w/replies, xml ) Need Help??


in reply to Re: Reading from text file
in thread Reading from text file

perl -aF: -ne 'chomp @F;push @{$h{$F[0]}},$F[2]}{print join(":",$_,@{$ +h{$_}}),"\n" for sort keys %h'

Are we going for golf?    :-)

echo "China:wd:2 Japan:wd:6 China:sg:2 Japan:sg:10 China:kng:70 Thailand:kng:6" | perl -F: -le'push@{$h{$F[0]}},$F[2]}{$,=":";print$_, +@{$h{$_}}for sort keys%h' China:2:2:70 Japan:6:10 Thailand:6

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found