[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SED problem



On Sat, Oct 04, 2003 at 07:25:32PM +0100, Dave selby wrote:
> I have multiple html files. I need to remove the same chunk of code from 
> all of them.
> I have made a bash loop to feed the files to sed, but am struggling with 
> the sed code.
> 
> 
> I need to delete all the code between
> 
> <!-- lockon:a:1
> -->
> 
> and
> 
> <!-- lockoff
> -->
> 
> Including the above comments.
> 
> I have tried, played with N, d substitution to // but can't pattern 
> match across multiple lines.
> 
> Any ideas ?

You can handle that sort of thing in perl pretty easily. The syntax is
pretty similar and the performance is about the same. However you get to
use variables, conditions, loops, etc.

Bijan
-- 
Bijan Soleymani <bijan@psq.com>
http://www.crasseux.com

Attachment: signature.asc
Description: Digital signature


Reply to: