extract all text lines between 2 lines in a file?
Tom Buskey
tom at buskey.name
Wed Apr 7 16:41:00 EDT 2004
> On Wed, Apr 07, 2004 at 03:05:52PM -0400, Tom Buskey <tom at buskey.name>
> wrote:
>> sed '0,/^uniqdelimiter/d' -e '/^uniqdelimter/d' file
>
> Odd, doesn't seem to be working for me.
Because I made a mistake. *sigh* I'm having ne of those days when you're
afraid to do rm -rf . w/o checking which window & directory you're in 1st.
sed -e '0,/^uniqdelimiter/d' -e '/^uniqdelimter/,$d' file
> FWIW, a Perl solution:
> perl -ne 'print if $m==1 and not /^uniqdelimiter/;$m+=/^uniqdelimiter/;'
> file
That's nicely susinct too.
More information about the gnhlug-discuss
mailing list