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

Re: keep only unique elements in an array displaying number of duplicates.

by Laurent_R (Canon)
on Aug 24, 2014 at 20:23 UTC ( [id://1098472]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ echo '
    james     yes
    ...
    dave    2
    jon     4
    ken     1
    
  2. or download this
    perl -nE 'my ($name, $val) = (split)[0,4]; $hash{$name} ++ if $val eq 
    +"yes"; END{ say "$_\t$hash{$_}" for keys %hash}'
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-25 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found