Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Matching Multiple Lines

by Kanji (Parson)
on Jan 02, 2003 at 21:48 UTC ( [id://223869]=note: print w/replies, xml ) Need Help??


in reply to Matching Multiple Lines

perl -ni.bak -e 'if ( /^0/ ) { for ( 1..7 ) { scalar <> unless eof } } else { print }' file

... but that doesn't handle cases where the 7 lines following a 0-prefixed line contain another 0-line (ie, should it the 'next 7' count reset?)

    --k.


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-23 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found