procmail
[Top] [All Lists]

Re: Bursting an archive file

2001-09-21 14:17:00
David W. Tamkin wrote:
Matthew wrote,

| I am not sure of how to set this up to burst this
| into separate messages with formail.  I only want to keep
| about 10% of the messages.
| It's obviously
| cat file|formail some parameters >> file

Only if you want to wear a big scarlet UUCA on your chest.  It should be

  formail -des < archive > file
        Ok, what does UUCA stand for?  Why is that syntax better than
the cat file| formail one.
        BTW, what I did was have a script to split up the mail messages
based on the ========================================== separator,
then piped that through formail and redirected it to the mailbox.
        The scripts are below, and probably ugly, but I am a 
mechanical engineer, not a programmer, so I don't do IT
elegance.
        On a 1.3 meg file, with about 550 messages, it ran in
about an hour:
#!/bin/sh 
# this is burstit, it calls burst
ans=1;
while [ $ans != 0 ]; do
burst | formail >>$HOME/mail/timebinders
ans=`ls -al /home/msaroff/timebx |awk '{print $5}'`
echo "${ans}";
date
done


#!/bin/sh
# this is burst
data=1;
tail +2 /home/msaroff/timebx > /home/msaroff/addrtmp
while [ "${data}" !=
"========================================================================="
]; do
data=`head -1 /home/msaroff/timebx`
if [ "${data}" !=
"========================================================================="
]
then
echo "${data}";
fi
tail +2 /home/msaroff/timebx > /home/msaroff/addrtmp
cp /home/msaroff/addrtmp /home/msaroff/timebx
done;

-- 
Matthew G. Saroff
msaroff(_at_)pobox(_dot_)com
_______________________________________________
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>