procmail
[Top] [All Lists]

Re: How to remove some text in the middle of a subject line

2004-03-11 05:50:38
On Wed, 10 Mar 2004, Christopher Benson wrote:



I'm looking for a way to remove some text from the middle of a subject line.

So for example, the text I need to remove is:

[TEX1]

But it might be in the middle of a subject line like:

  TPS20001-34987 [TEX1] How do I change my config?

and in the end I need it to say:

  TPS20001-34987 How do I change my config?


So in the MATCH type things I've done before I know the \/ can grab what's
after it but not sure how to word the syntax to look in front of it.  I
figure I'm going to have to do a match before and a match after  then piece
the 2 together in the final subject.

        And what are you going to do with:

TPS20001-34987 [TEX1] How do [TEX1] change [TEX1] ....

        As Sean said before, sed(1) could be good answer:

* ! MATCH ?? ^^\[TEX\]
| sed '/^Subject:/{s/\[TEX1\]//g;s/  */ /g;}'

        perl is a little bit havy.

        I understand that you do not want to chage subject that
        started with "[TEX1]", does it?

Bye,
 Udi




Any pointers?

Thanks,

-Chris


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


 +++++++++++++++++++++++++++++++++++++++++++
 This Mail Was Scanned By Mail-seCure System
 at the Tel-Aviv University CC.


---------------------------------------------------------------------------
Udi Motelo - Unix System Administrator.
Faculty of Engineering
Tel-Aviv University
Wolfson Building; room 004
E-Mail: uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il
Phone: 972-3-6408958
---------------------------------------------------------------------------

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