Re: splitting archives into months

From: Charles Hall <chall_at_totalsports.net_at_hypermail-project.org>
Date: Wed, 26 Aug 1998 10:28:31 -0400
Message-ID: <35E41B8F.4185_at_totalsports.net>


Kevin Shrieve wrote:
>
> I have a fat archive that I'd like to split up by month, like I see so many
> others doing. Is there a description somewhere of a procedure to follow,
> or will I just have to think it through?

This Perl script worked for me. It creates a new output file for each month in the mail archive.

 while(<>) {

    if (/^From /) {

       $date = substr($_,-21);
       chop $date;
       $mon = substr($date,-4) . "-" . substr($date,0,3);
       if ($omon ne $mon) {
          open(OUT,">$mon") || die "open: $!\n";
          $omon = $mon;
          print "$mon\n";
       }

    }
    print OUT $_;
 }
-- 
Charles Hall
Total Sports
Raleigh, NC USA
http://info.totalsports.net
Received on Wed 26 Aug 1998 04:33:07 PM GMT

This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:11 AM GMT GMT