Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Count Quoted Words

by jaredor (Deacon)
on Jun 07, 2013 at 06:33 UTC ( #1037596=note: print w/ replies, xml ) Need Help??


in reply to Count Quoted Words

If you just want the count of all white space words within double quotes in a text file, you don't need to keep much information hanging around. Try filtering:

perl -E 'say 0+map{split}grep{$i++%2}split/"/,do{undef$/;<>};' fil.txt

(Please pardon the golfing, I have this thing about keeping one-liners on one line ;-)


Comment on Re: Count Quoted Words
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (18)
As of 2014-07-30 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (234 votes), past polls