ftp.nice.ch/peanuts/GeneralData/Usenet/news/1991/CSN-91.tar.gz#/comp-sys-next/1991/May/Heres-how-to-put-news-into-Mail.app

This is Heres-how-to-put-news-into-Mail.app in view mode; [Up]


Date: Sun 06-May-1991 01:46:58 From: das15@cunixa.cc.columbia.edu (Douglas A Scott) Subject: Here's how to put news into Mail.app I had posted an awk script which was my first attempt at reformatting mboxes and news mailbox-style files for the NeXT, but I just sat down and rewrote it so that it works 98% of the time. Just take any mbox that currently causes Mail.app to barf (vax mboxes did, and so do all saved news mailboxes) and say convert bad.mbox > good.mbox save this script as "convert" (or whatever) and just run it as a shell script. ++++++++++++++++++++++++++++++++++++ $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 This works much better than the old one! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Douglas Scott Columbia University Computer Music Studio
Date: Sun 06-May-1991 17:23:54 From: das15@cunixa.cc.columbia.edu (Douglas A Scott) Subject: Re: Here's how to put news into Mail.app 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

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.