Re: splitting archives into months

From: Kent Landfield <kent_at_hypermail-project.org>
Date: Wed, 26 Aug 1998 10:06:09 -0500 (CDT)
Message-Id: <199808261506.KAA24935_at_landfield.com>


#
# 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 $_;
# }

Nice. I'll save this one in my bag-o-tricks. ;)

Kevin, you'd be better off upgrading to 2.0b3. It is much stabler than 1.02 and has new features you might find useful. In it is a directory named archive/ that has tools to do just what you wanted to do.

-- 
Kent Landfield                        Phone: 1-817-545-2502             
Email: kent_at_landfield.com             http://www.landfield.com/
Email: kent_at_nfr.net                   http://www.nfr.net/
Please send comp.sources.misc related mail to kent_at_landfield.com
Search the Usenet FAQ Archive at http://www.faqs.org/faqs/
Received on Wed 26 Aug 1998 05:06:57 PM GMT

This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:49 PM GMT GMT