Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: separate word count for each line of a file

by melb100 (Initiate)
on Nov 22, 2012 at 19:24 UTC ( #1005176=note: print w/ replies, xml ) Need Help??


in reply to Re: separate word count for each line of a file
in thread separate word count for each line of a file

Thank you for your tips monks,

I am researcher and I needed to check lisst of experimental sentences very quickly (definitely not homework! ;-) ) so in the end I went for the most basic of solutions and am just running

perl -ne "{print tr/ //, $/}" FILE
on all my files and scanning down the resulting word counts for outliers. Not very elegant!!

I am afraid that as a complete novice (this being the first thing I have ever tried to do in perl) I wasn't clever enough to work out number of words on each line from your hints. If there is a more elegant solution I'd be grateful but in the meantime this will do! :)

Thanks again for trying to help, and I promise to persevere with the "proper" solution when time is less pressing!

m


Comment on Re^2: separate word count for each line of a file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-12-20 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls