procmail
[Top] [All Lists]

Re: removing line

2002-01-21 20:24:11
hey, that actually works... :) thanks!

how would I combine this with the matching of for example a malinglist and
move the message to a specific folder?

this is what I have today, but I can't seem to be able to fit that remove
line thing into it...

 :0:
 * ^From:(_dot_)*some(_at_)mailinglist(_dot_)com
 mailinglist

/rikard

----- Original Message -----
From: "David W. Tamkin" <dattier(_at_)ripco(_dot_)com>
To: <procmail(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE>
Sent: Monday, January 21, 2002 10:35 PM
Subject: Re: removing line


Rikard asked,

| I'm kinda new to this and I wonder how to simply remove a line from the
| body of a message containg a certain sentence or words in a procmail
| filter, before delivering the message.

 :0Bbfw
 * pattern
 | grep -v 'pattern'

That will remove every line that the pattern is on.  If it can appear more
than once and you want to remove only the first occurrence, you can use
this action line instead:

 | sed -e '1,/pattern/{' -e'/pattern/d' -e '}'

If you want to delete only the second, or third, or Nth, or last, it gets
a lot more complicated.


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