fixing archive threads

There were some messages in the archive with an unusual form of
In-Reply-To header. Neither smartlist nor mutt could thread them
properly and I get fed up trying to follow the thread so I fixed them
for my mbox and for the W3C archive[1]. I fixed my mbox archive with
an emacs replace-regexp replacing:
^In-Reply-To: Message from "\([^"]+\)" <\([^>]+\)>
 + of "\([^"]+\)" <\([^>]+\)>$
with:
In-Reply-To: <\4>; from \2 on \3

The list archive [1] was in maildir format (one file per messsage) so
I didn't want to edit each one. Instead I used perl's in-place editing
factilities:
perl -ni -e "if (\$state == 1) {     if (m/^ +of \\\"([^\\\"]+)\\\" <([^>]+)> *\$/) {   print \"In-Reply-To: <\$2>; from \$from on \$1\";     } else {   print STDERR \"mismatch: \$.\\n\";     }     \$state = 0; } else {     if (m/^In-Reply-To: Message from ([^\<]+)<([^>]+)> */) {   \$from = \$3;   \$state = 1;     } else {   print;     } }" *

Hopefully others may benifit from my obsessiveness.

[1] http://lists.w3.org/Archives/Public/www-rdf-rules/
-- 
-eric

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Thursday, 13 September 2001 12:48:27 UTC