On Tue, Feb 10, 2004 at 02:27:14PM -0700, LuKreme wrote:
next step is to get MYMONTH to "05" from "5" but I think that's pretty
trivial
TMONTH = "0"$MYMONTH
TMONTH ?? ().*\/..
MYMONTH=$MATCH
or something.
Here's what I do. This is for the date, not month,
but same diff.
:0 # 021212 () find DD
* $ FROM_ ?? ()\<$MONTH +\/[1-3]?[0-9]
* MATCH ?? ^^..
{ DD = $MATCH }
:0 E # 021211 () replace space as necessary
{ DD = 0$MATCH }
DATE = $YY$MM$DD
I've been using that for exactly fourteen months today.
Alternatively, one could use more scoring; something like
:0
* $ $MATCH^0
{
DD = $= # we've now stripped off any leading 0's
:0
* 10^0
* $ -$DD^0
{ DD = 0$DD }
}
Seems kind of silly on the one hand, but on the other it
may be slightly more readable.
Nah . . . :-)
--
dman
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail