Newsgroups: comp.sys.next
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!cunixa.cc.columbia.edu!das15
From: das15@cunixa.cc.columbia.edu (Douglas A Scott)
Subject: Re: Here's how to put news into Mail.app
Message-ID: <1991May6.172354.15332@cunixf.cc.columbia.edu>
Summary: My goof, sorry!
Sender: usenet@cunixf.cc.columbia.edu (The Network News)
Nntp-Posting-Host: cunixa.cc.columbia.edu
Reply-To: das15@cunixa.cc.columbia.edu (Douglas A Scott)
Organization: Columbia University
References: <1991May6.014658.12686@cunixf.cc.columbia.edu>
Date: Mon, 6 May 1991 17:23:54 GMT

Terribly sorry folks...I left off the first line of the awk shell script!
Here is the whole thing again:
----------------
awk '
$1 !~ /^Date:/ && $1 !~ /^From: /       { entry[line]=$0; line++;}
/^From: / { 
            printf ("%s %s %s\n", "From", name, fromdate);
            print origfrom;
            print origdate;
            while(i < line-1) { print (entry[i]); i++;}
            i=0; line=0;
            printf ("\n\n\n\n");
            origfrom=$0;
            if ( $2 !~ /^[A-Za-z]/ ) name = substr($2,2,length($2));
            else name = $2;
          }
/^Date: / { origdate=$0;
                if ( $2 ~ /^[0-9]/ ) {
                        if( length($7) == 0 ) $7="Sun";
                        fromdate=sprintf("%s %s %s %s 19%s", $7, $3, $2, $5, $4);}
                else if ( $3 ~ /^[0-9]/ )
                        fromdate=sprintf("%s %s %s %s 19%s", substr($2,0,length($2)-1), $4, $3, $6, $5);
                else
                        fromdate=sprintf("%s %s %s %s %s", $2, $3, $4, $5, $6);
          } 
' $1

Some people have reported having problems with this.  All it does is add one
new line at the beginning of each news mail article, beginning with the word
"From" followed by a space (no colon!), then the person's name, and a
specially formatted date (hence the fancy awk stuff for the date).  Perhaps
this script gets munged by rn?  Let me know if you have problems.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Douglas Scott          Columbia University Computer Music Studio 
Internet: <doug@woof.columbia.edu> <das15@cunixa.cc.columbia.edu>
UUCP: ...!columbia!woof!zardoz!doug          Phone: (703)765-4771
