in reply to A Clarification
in thread Matching Multiple Lines

perl -0777 -pi.bak -e 's/^0(.*\n){1,8}//mg' file

Sure it's a lot more compact, but it suffers the same problem as my non-regex solution, is going to suck majorly for large files, and is (IMHO) less obvious about what it's actually doing, especially to those unfamiliar with Perl (YMMV).

    --k.

Update: Oops, meant -0777 not -00.


Replies are listed 'Best First'.
Re: Re: Matching Multiple Lines (Re: A Clarification)
by Wally Hartshorn (Hermit) on Jan 03, 2003 at 15:16 UTC

    Very good, Kanji! That does exactly what I want! Speed isn't really an issue, and it's a one-time task. The file is several thousand lines long, and doing it by hand just didn't appeal. :-)

    This will be a great help. Thanks!

    Wally Hartshorn