Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: count of a word occurrence

by chimni (Pilgrim)
on Mar 23, 2004 at 04:15 UTC ( [id://338886]=note: print w/replies, xml ) Need Help??


in reply to count of a word occurrence


1) read the file in a while loop,split and use a hash ($hash{$_}++ ).
2) use someting like the below for all unique entries in the first column.
grep 817 filename | wc -l
hth
chimni

Replies are listed 'Best First'.
Re: Re: count of a word occurrence
by jdporter (Paladin) on Mar 23, 2004 at 04:59 UTC
    That won't quite get it. Do
    cut -f1 filename | sort | uniq -c

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://338886]
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: (4)
As of 2024-03-29 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found