[H-GEN] replacing text between 2 strings
Clinton Roy
croy at dstc.edu.au
Wed Jan 8 17:35:17 EST 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
Hi Shaun; please, when starting a new thread, don't follow up on a
previous one,
Shaun Nykvist <shaun at kangawallafox.com.au> writes:
> I have about 200 text files where I need to delete the text between
> multiple occurrences of 2 constant strings. For example
> Return-Path
>
> various text here
>
> Date
For a single file:
sed '/^Return-Path$/,/^Date$/c\
Return-Path\
Date\
' input_file > output_file
I haven't found a way to do non inclusive sed addresses.
Remember to back up your data before doing anything :)
happy scripting,
--
Clinton Roy
Meetings - ``Try, or no try; there is no do.''
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list