Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Count Quoted Words

by jaredor (Curate)
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?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2015-11-27 07:02 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (719 votes), past polls