Re: MSGSEP problem

1997-05-27 14:52:57
Don't ask me why but I have to deal with a separator which is :

<bigger><bigger>---- COUPEZ ICI ---- CUT HERE ---- COUPEZ ICI ---- CUT
HERE -------</bigger></bigger>

With a white line before and a white line after.

How do I set my <<MSGSEP> to deal with the whites lines (actually they
are just CR)? I've tried a bunch of things and it doesn't work. The
best, so far, are messages correctly separated but with no "subject",
"date" and "from" fields.

How do I have to say "the separator is these three lines, two of them
being blanks ?"

You can't.  MHonArc only supports single line separators.

However, there is a work-around.  You can write a simple preprocessor
that strips out the blank line after the separator and pipe the
output to MHonArc.  For example:

    shell% fixsep funky.mbox | mhonarc -msgsep "..." -- -

2.0.1 of mhonarc allows you to specify stdin as the source of
a mailbox.  You need the "--" to terminated option parsing so the
"-" will be treated as stdin.  Replace "..." with the ugly message
separator.  Plus, define any other options you may desire.

Your "fixsep" script might look like the following:


        $msgsep = "<bigger><bigger>---- COUPEZ ICI ---- CUT HERE";
        while (<>) {
            print STDOUT $_;
            scalar(<>)  if /^$msgsep/o;

The script does not remove the preceding blank line of the
separator, but it probably does not matter.

Hope this helps,


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