procmail
[Top] [All Lists]

Re: Removing blocks of text

2002-10-28 03:00:28
On Sun, 27 Oct 2002, Tephra Lynn Davis wrote:

I've been trying to come up with a recipe to remove blocks of text (ads)
from a newsletter I receive daily.  The blocks have distinctive start and
end lines so I'd hope it would be relatively easy.  Unfortunately my brain
seems to be on vacation.

Here's a sample ad block:

/-=-=-[advertisement]-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\
I CAN HELP ANYONE GET MORE MONEY FAST---and I can prove it!
<insert several more lines of garbage here>
\-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-/

I need a recipe that will remove those distinctive lines and everything in 
between them while leaving the rest of the message
intact.  Help?


:0 fw
| sed '/^\/-=-=-.advertisement/,/^\\-=-=-=/d'
       ^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^
           from string          to string

Bye,
 Udi


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>