[H-GEN] replacing text between 2 strings

Shaun Nykvist shaun at kangawallafox.com.au
Wed Jan 8 22:02:03 EST 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

Hi all

I have managed to solve part of the problem (thanks to those who 
responded), however is there a way to insert a line break or carriage 
return after a specified text string, in a text document.

Cheers
Shaun


At 08:35 AM 9/01/2003 +1000, you wrote:
>[ 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/


--
* 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