Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How do I count the frequency of words in a file and save them for later?

by rcaputo (Chaplain)
on Feb 05, 2009 at 03:12 UTC ( #741482=note: print w/replies, xml ) Need Help??


in reply to How do I count the frequency of words in a file and save them for later?

The standard UNIX tool chain works fine:

perl -nle "print for /(\w['\w-]*)/g" input.text | sort | uniq -c | sor +t -rn | tee word-list.text
  • Comment on Re: How do I count the frequency of words in a file and save them for later?
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2022-10-04 23:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (19 votes). Check out past polls.

    Notices?