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

Re: One liner

by ikegami (Patriarch)
on Jun 02, 2009 at 15:14 UTC ( [id://767629]=note: print w/replies, xml ) Need Help??


in reply to One liner

You're processing a line at a time, but the string your are trying to match spans two lines.

You could switch to paragraph mode.

perl -nle'BEGIN { $/ = "" } print /^Total SE ON.*?(\d+)/s' *

Replies are listed 'Best First'.
Re^2: One liner
by manav_gupta (Acolyte) on Jun 02, 2009 at 15:24 UTC
    Hmm... I did try that... but at least that particular version didn't work for me... Time to look at the paragraph mode.
      It's cause your blank lines aren't actually blank!
      $ perl -ple's/^\s+//' * | perl -ne'BEGIN { $/ = "" } print /^Total SE + ON.*?(\d+)/s' 39035

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2024-04-18 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found