Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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?
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 taking refuge in the Monastery: (5)
As of 2014-10-02 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls