Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Matching Multiple Linesby Kanji (Parson) |
on Jan 02, 2003 at 21:48 UTC ( [id://223869]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|