Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: count of a word occurrence

by chimni (Pilgrim)
on Mar 23, 2004 at 04:15 UTC ( #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 (Chancellor) 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? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-01-26 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?