Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 ;-)

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 drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2016-06-30 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (396 votes). Check out past polls.