Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Think about Loose Coupling
 
PerlMonks  

Re: count of a word occurrence

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 22, 2004 at 23: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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.