Tim Chase <[EMAIL PROTECTED]> writes:
>> I wish to delete lines that are in between 'abc' and
>> 'xyz' and print the rest of the lines. Which is the best
>> way to do it?
>
>        sed -n -e'1,/abc/p' -e'/xyz/,$p' file.txt
>
>which is pretty straight-forward.

While it looks neat, it will not work when /abc/ matches line 1.
Non-standard versions of sed, e.g., GNU, allow you to use 0,/abc/
to neatly step around this nuisance; but for standard sed you'll
need a more complicated sed script.
--
John Savage                   (my news address is not valid for email)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to