🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
9 messages
9 total messages Started by Henrik Roseno Mon, 23 May 1994 23:35
New utility: Converts nn-files to rnews-batches!
#5886
Author: Henrik Roseno
Date: Mon, 23 May 1994 23:35
407 lines
18419 bytes
ANNOUNCEMENT of a new utility program!

The following pascal program takes files saved by nn (the S-command),
and converts them into rnews-batches, according to RFC-1036 section
4.3. These files can then be loaded by rnews in news systems. The
*.MSG files in the SOUP-packets are also rnews-batches, so the files
can also be imported by SOUP-readers. It has been tested with Yarn
v0.65.


  Henrik
-- 
| Henrik Roseno, MSc.         |    Tel: + 45 35 36 52 76    | East or West, |
| Norrebrogade 49C, 1.tv.     |    FAX: + 45 35 26 25 93    | Cyberspace is |
| 2200 Copenhagen N - DENMARK | e-mail: hero@login.dkuug.dk | best   - HeRo |


-------------  Start of Pascal source file NNRNEWS.PAS:  ---------------
{ NNRNEWS.PAS ver. 1.00 - May 23, 1994. Programmed in Turbo Pascal 6.0 by

  Henrik Rosen�
--
| Henrik Rosen�, MSc.         |    Tel: + 45 35 36 52 76    | East or West, |
| N�rrebrogade 49C, 1.tv.     |    FAX: + 45 35 26 25 93    | Cyberspace is |
| 2200 Copenhagen N - DENMARK | e-mail: hero@login.dkuug.dk | best   - HeRo |

NNRNEWS.PAS Copyright (c) 1994 Henrik Rosen�.

License conditions:
This program is freeware and distributed as a TP 6.0 source file.
I do not take any responsibility for the consequences of compiling or
running the program. Alteration and redistribution is allowed, as long
as the file is only altered below the following line.
--------------------------------------------------------------------------

  NNRNEWS convertes files saved by nn into rnews-batches (according
  to RFC-1036 section 4.3), by inserting the '#! rnews <x>'-line before
  the headers of all the postings in the file. When saved by nn, the
  messages are simply separated by an empty line. It has been tested,
  that Yarn v0.65 can import these rnews-batches.

  The program requires access to FLIP.EXE, to work!
  (FTP or download FLIP1EXE.ZIP from somewhere)

  The nnrnews command:

      nnrnews [searchstring [directory]]

        searchstring  The files to be processed ex. *.doc.
                      Default is *.*
                      (At least on DR DOS 6.0 *.* does not work!)

        directory     The directory to be searched for files to convert.
                      Default is current directory on default drive.

When compiled in TP 6.0, his program cuts down lines to 255 characters.
Some header lines (especially Path: and Xref:, but also Newsgroups:) are
longer than 255 characters, and are damaged.
Lines that where cut, are copied to the file cutlines.uvy, for manual
evaluation of the damage!
Anybody with TP 7.0 are encouraged to program a version of the program,
that does not cut any lines.

  All <space>-characters in the end of any line is removed in the process.
  This feature is an integrated part of the whole algorithm.
  The program allows the file to start with whatever before the first
  news-message, and moves that to 'crapfile.uvy'.

  The program detects the starting of a new message by the following
  criteria:
  After an empty line, all the required headers (according to RFC-1036)
  are found among the headers before the next empty line (or max. 50 lines).
  The required headers are:
  "From:", "Date:", "Newsgroups:", "Subject:", "Message-ID:" and "Path:".

  This algorithm is nearly 100% sure of detecting the start of a message,
  but:
  1. If a message contains a forwarded message, the forwarded message will
     be regarded as a new message, if the 6 required headers are unchanged
     and there is an empty line just before these headers.
  2. If the first header is very wierd and therefore unknown (see the
     is_header-function), the program will not regard it as the start of
     a new message.
  3. If the block of headers contains an empty line before the 6 required
     headers have been found, the program will not regard it as the start
     of a new message.

  The program can _probably_ handle up to 8000 messages in one file,
  depending only on allocated heap. The size of files only depend on the
  diskspace for the temporary copy.
  The program uses 2 passes:
  1. It finds the starting points of messages, places '#! rnews' and
     counts the size of the messages in bytes. These numbers are placed
     in a list chained with pointers.
  2. The numbers in the list are placed in the '#! rnews'-lines.
  Well, there are actually 2 more passes (calling FLIP.EXE):
  Before, all the files are converted to DOS-ASCII, by inserting <Carriage
  Return> at newline (for Turbo Pascal to be able to handle them as text
  files), and in the end they are converted (back) to UNIX-text-format,
  by removing the <Carriage Return>s at all newlines, to create a real
  rnews-batch.
}

program nnrnews;
{$I-}
{$M 16000,0,65000 }
uses    dos,crt;
type
  int_point = ^longint_rec;
  longint_rec = record
                  count: longint;
                  next: int_point;
                end;
var
  first_pointer, last_pointer, temp_pointer
                              : int_point;
  empty_line, empty_oldline, is_from, is_date, is_newsg, is_subj, is_mess,
    is_path, all_headers, is_a_header, is_newsfile
                              : boolean;
  infil, udfil, crapfile, cutlinefile
                              : text;
  l, i, str_count             : integer;
  message_counter             : longint;
  streng, streng2, streng3    : string;
  str_arr                     : array[1..50] of string;
  dirinfo                     : searchrec;

procedure required_heads(streng:string);
begin
  { The required headers:  "From:", "Date:", "Newsgroups:", "Subject:",
                           "Message-ID:" and "Path:" }
  if copy(streng,1,5)='Path:'        then is_path:=true else
    if copy(streng,1,11)='Newsgroups:' then is_newsg:=true else
      if copy(streng,1,5)='From:'        then is_from:=true else
        if copy(streng,1,5)='Date:'        then is_date:=true else
          if copy(streng,1,8)='Subject:'     then is_subj:=true else
            if copy(streng,1,10)='Message-ID'  then is_mess:=true else
              if copy(streng,1,10)='Message-id'  then is_mess:=true;
end;

function is_header(streng:string): boolean;
var is_head : boolean;
{ I believe this function is quite time-optimal! }
begin
  if streng='' then  is_head:=false  else
    if copy(streng,1,1)='-' then  is_head:=false  else
      if copy(streng,1,1)=' ' then  is_head:=false  else
        { The required headers:  "From:", "Date:", "Newsgroups:",
          "Subject:", "Message-ID:" and "Path:" }
        if copy(streng,1,5)='Path:' then
          begin is_head:=true; is_path:=true end else
          if copy(streng,1,11)='Newsgroups:' then
            begin is_head:=true; is_newsg:=true end else
            begin
            is_head:=false;
            if copy(streng,1,5)  = 'From:'       then
              begin is_head:=true; is_from:=true end;
            if copy(streng,1,5)  = 'Date:'       then
              begin is_head:=true; is_date:=true end;
            if copy(streng,1,8)  = 'Subject:'    then
              begin is_head:=true; is_subj:=true end;
            if copy(streng,1,10) = 'Message-ID'  then
              begin is_head:=true; is_mess:=true end;
            if copy(streng,1,10) = 'Message-id'  then
              begin is_head:=true; is_mess:=true end;
            if copy(streng,1,5)  = 'Xref:'          then is_head:=true;
            if copy(streng,1,8)  = 'Expires:'       then is_head:=true;
            if copy(streng,1,8)  = 'Control:'       then is_head:=true;
            if copy(streng,1,13) = 'Distribution:'  then is_head:=true;
            if copy(streng,1,9)  = 'Keywords:'      then is_head:=true;
            if copy(streng,1,8)  = 'Summary:'       then is_head:=true;
            if copy(streng,1,9)  = 'Approved:'      then is_head:=true;
            if copy(streng,1,9)  = 'Comments:'      then is_head:=true;
            if copy(streng,1,6)  = 'Lines:'         then is_head:=true;
            if copy(streng,1,13) = 'MIME-Version:'  then is_head:=true;
            if copy(streng,1,13) = 'MIME-version:'  then is_head:=true;
            if copy(streng,1,13) = 'Mime-Version:'  then is_head:=true;
            if copy(streng,1,13) = 'Mime-version:'  then is_head:=true;
            if copy(streng,1,5)  = 'NNTP-'          then is_head:=true;
            if copy(streng,1,5)  = 'Nntp-'          then is_head:=true;
            if copy(streng,1,8)  = 'Content-'       then is_head:=true;
            if copy(streng,1,2)  = 'X-'             then is_head:=true;
            if copy(streng,1,12) = 'In-reply-to:'   then is_head:=true;
            if copy(streng,1,12) = 'In-Reply-To:'   then is_head:=true;
            if copy(streng,1,13) = 'Organization:'  then is_head:=true;
            if copy(streng,1,11) = 'References:'    then is_head:=true;
            if copy(streng,1,9)  = 'Followup-'      then is_head:=true;
            if copy(streng,1,6)  = 'Reply-'         then is_head:=true;
            if copy(streng,1,7)  = 'Return-'        then is_head:=true;
            if copy(streng,1,7)  = 'Errors-'        then is_head:=true;
            if copy(streng,1,7)  = 'Sender:'        then is_head:=true;
            end;
  is_header:=is_head
end;

{ main program }
begin
  writeln;
  writeln('The program can be terminated by Ctrl-Break.');
  writeln;
  if paramcount=2 then
    begin
      chdir(paramstr(2));
      getdir(0,streng);
      streng3:=paramstr(1)
    end
  else
    if paramcount=1 then
      begin
        streng3:=paramstr(1);
        getdir(0,streng)
      end
    else
      begin
        getdir(0,streng);
        streng3:='*.*'
      end;

  writeln('The file(s) ',streng3,' in directory ',streng,' will be converted into rnews-batches.');
  write('Is this okay ? (y/n) ');
  readln(streng2);
  if (copy(streng2,1,1)<>'y') and (copy(streng2,1,1)<>'Y') then halt;
  FindFirst(streng3, $3F, DirInfo);
  if (Doserror=0) and (dirinfo.name<>'.') then
    begin
      WriteLn('Temporary insertion of <Carriage Return>s at newline in all file(s).');
      streng := Fexpand(Fsearch('FLIP.EXE',getenv('PATH')));
      streng2:=' -mb '+streng3;
      swapvectors;
      exec(streng,streng2);
      swapvectors;
      if doserror<>0 then begin
        writeln('FLIP.EXE could not be executed, program terminated.');
        halt
      end;
    end
  else
    begin
      writeln('The directory does not contain any files matching ',streng3);
      halt
    end;
  assign(crapfile,'crapfile.uvy');
  rewrite(crapfile);
  assign(cutlinefile,'cutlines.uvy');
  rewrite(cutlinefile);
  FindFirst(streng3, $3F, DirInfo);
  { Processing one file at a time: }
  while (Doserror=0) and (dirinfo.name<>'.') do begin
    WriteLn('Processing ',DirInfo.Name);
    if dirinfo.size+6000>diskfree(0) then
      writeln('There is probably not enough diskspace. The file will not be processed.')
    else begin
      assign(infil,dirinfo.name);
      reset(infil);
      readln(infil,streng);
      if copy(streng,1,9)='#! rnews ' then
        writeln('The file is probably allready an rnews-batch. It will not be processed.')
      else
        begin
        assign(udfil,'temp.fil');
        rewrite(udfil);
        new(first_pointer);
        last_pointer:=first_pointer;
        first_pointer^.count:=0;
        first_pointer^.next:=nil;
        writeln(crapfile,'');
        writeln(crapfile,'------------------- start of crap from ',dirinfo.name,' ------------------');
        writeln(crapfile,'');
        writeln(cutlinefile,'');
        writeln(cutlinefile,'----------- start of lines cut to 255 characters from ',dirinfo.name,' ----------');
        writeln(cutlinefile,'');
        while not eof(infil) and not is_header(streng) do
          begin writeln(crapfile,streng); readln(infil,streng) end;
        message_counter:=0;
        if eof(infil) then
          begin
            writeln(crapfile,streng);
            writeln('The file does not seem to contain any USENET-news messages.')
          end
        else
        begin
          is_newsfile:=false;
          while not eof(infil) do begin
            { The possible start of a new message has been detected: }
            is_from:=false; is_date:=false; is_newsg:=false;
            is_subj:=false; is_mess:=false; is_path:=false;
            all_headers:=false;
            l:=length(streng);
            while (streng[l]=' ') and (l>0) do begin
              delete(streng,l,1);
              dec(l); { l:=l-1; }
            end;
            str_count:=1; str_arr[1]:=streng;
            required_heads(streng);
            while not eof(infil) and (str_count<50) and not all_headers
              and (streng<>'') do
            begin
              readln(infil,streng);
              l:=length(streng);
              if l=255 then writeln(cutlinefile,streng);
              while (streng[l]=' ') and (l>0) do begin
                delete(streng,l,1);
                dec(l); { l:=l-1; }
              end;
              inc(str_count);
              str_arr[str_count]:=streng;
              required_heads(streng);
              all_headers:=(is_from and is_date and is_newsg and
                            is_subj and is_mess and is_path)
            end;
            if streng='' then empty_line:=true else empty_line:=false;
            if all_headers then begin
              is_newsfile:=true;
              writeln(udfil,'#! rnews');
              if message_counter>0 then begin
                last_pointer^.count:=message_counter;
                new(last_pointer^.next);
                last_pointer:=last_pointer^.next;
                last_pointer^.next:=nil;
                message_counter:=0;
              end;
            end;
            for i:=1 to str_count do begin
              writeln(udfil,str_arr[i]);
              message_counter:=message_counter+length(str_arr[i])+1;
            end;
            { No matter whether a new message started or not, we can now copy
              from infil to udfil, counting bytes, until detecting an empty
              line followed by a header line. }
            empty_oldline:=false; is_a_header:=false;
            while not eof(infil) and not (empty_oldline and is_a_header) do
            begin
              readln(infil,streng);
              l:=length(streng);
              if l=255 then writeln(cutlinefile,streng);
              while (streng[l]=' ') and (l>0) do begin
                delete(streng,l,1);
                dec(l); { l:=l-1; }
              end;
              empty_oldline:=empty_line;
              if streng='' then empty_line:=true else empty_line:=false;
              { There is no reason for searching for headers inside a
                paragraph, neither when we are still in the header-block
                of current message: }
              if empty_oldline<>empty_line then
                is_a_header:=is_header(streng)
              else
                is_a_header:=false;
              if not is_a_header then begin
                writeln(udfil,streng);
                message_counter:=message_counter+length(streng)+1
              end;
            end;
          end; { end-while not eof(infil) }
          close(infil);
          close(udfil);
          if is_newsfile then
          begin
            last_pointer^.count:=message_counter;
            reset(udfil);
            rewrite(infil);
            while not eof(udfil) do begin
              readln(udfil,streng);
              if streng='#! rnews' then begin
                if first_pointer=nil then begin
                  writeln('Program error: Unexpected end of integer pointer-list!');
                  exit
                end;
                str(first_pointer^.count,streng2);
                streng:=streng+' '+streng2;
                temp_pointer:=first_pointer^.next;
                dispose(first_pointer);
                first_pointer:=temp_pointer;
              end;
              writeln(infil,streng);
            end;
            if first_pointer<>nil then
            begin
              writeln('Program error: Too many integers in pointer-list!');
              exit
            end;
          end; { end_if: testing is_newsfile }
        end; { end-if: testing of any messages at all }
        close(udfil)
      end; { end-if: testing if first line in file is '#! rnews ' }
      close(infil);
      { I can't see what else should be needed here...? }
    end; { end-if: testing necessary free disk space }
    findnext(dirinfo);
  end; { end-while: doserror = 0 }
  close(crapfile);
  close(cutlinefile);
  WriteLn('Deleting <Carriage Return>s at newline in all file(s).');
  streng := Fexpand(Fsearch('FLIP.EXE',getenv('PATH')));
  streng2:=' -ub '+streng3;
  swapvectors;
  exec(streng,streng2);
  swapvectors;
  streng2:='/C del temp.fil';
  SwapVectors;
  Exec(GetEnv('COMSPEC'), streng2);
  SwapVectors;
  if DosError <> 0 then
    WriteLn('Could not execute COMMAND.COM - temp.fil not deleted.');
end.

Re: New utility: Converts nn-files to rnews-batches!
#5896
Author: Frank McNeil
Date: Fri, 27 May 1994 20:32
46 lines
2179 bytes
In article <TE-tju2nwmGB065yn@login.dkuug.dk>, Henrik Roseno wrote:
>ANNOUNCEMENT of a new utility program!
>
>The following pascal program takes files saved by nn (the S-command),
>and converts them into rnews-batches, according to RFC-1036 section
>4.3. These files can then be loaded by rnews in news systems. The
>*.MSG files in the SOUP-packets are also rnews-batches, so the files
>can also be imported by SOUP-readers. It has been tested with Yarn
>v0.65.
>
>
>  Henrik
>--
>| Henrik Roseno, MSc.         |    Tel: + 45 35 36 52 76    | East or West, |
>| Norrebrogade 49C, 1.tv.     |    FAX: + 45 35 26 25 93    | Cyberspace is |
>| 2200 Copenhagen N - DENMARK | e-mail: hero@login.dkuug.dk | best   - HeRo |
>
>
>-------------  Start of Pascal source file NNRNEWS.PAS:  ---------------

Hello

  Thanks Henrik!

  It worked after

    1. Commented out 'set mail_format' that was in my ~/.nn/init file.

    2. Created a matching AREAS file.


Question:
---------
  It wouldn't work for me until I created a matching AREAS file.  Am I
doing something wrong?

  This is great!!!  Thank you.

Frank



---
Frank McNeil, Tax Code Junkie    ftp.netcom.com:/pub/ftmexpat/*
ftmexpat@netcom.com              //nonres, expat tax refr/pgm
Re: New utility: Converts nn-files to rnews-batches!
#5898
Author: Henrik Roseno
Date: Sat, 28 May 1994 01:34
22 lines
1691 bytes
In article <DEoujyr28zpM065yn@netcom.com>, Frank McNeil wrote:
> In article <TE-tju2nwmGB065yn@login.dkuug.dk>, Henrik Roseno wrote:
> >ANNOUNCEMENT of a new utility program!
>   Thanks Henrik!
> Question:
> ---------
>   It wouldn't work for me until I created a matching AREAS file.  Am I
> doing something wrong?

No.
You are importing a SOUP-packet, which consist minimum of a *.MSG file
and an AREAS file.
If your reader can import an rnews-batch directly, like Yarn (using
the appropriate option), you don't need to create an AREAS file.


  Henrik
-- 
| Henrik Roseno, MSc.         |    Tel: + 45 35 36 52 76    | East or West, |
| Norrebrogade 49C, 1.tv.     |    FAX: + 45 35 26 25 93    | Cyberspace is |
| 2200 Copenhagen N - DENMARK | e-mail: hero@login.dkuug.dk | best   - HeRo |
Re: New utility: Converts nn-files to rnews-batches!
#5905
Author: Dane Beko
Date: Sun, 29 May 1994 14:01
7 lines
998 bytes
In article <TE-tju2nwmGB065yn@login.dkuug.dk>, Henrik Roseno wrote:

 > ------------- Start of Pascal source file NNRNEWS.PAS:

If someone has compiled this for DOS, I'd like a copy of the binary
please.  I don't have a Pascal compiler. :(  Thanks.
What is an rnews-batch (I nead reading material); Yarn import problem
#5913
Author: Frank McNeil
Date: Tue, 31 May 1994 17:07
88 lines
3782 bytes
In article <w-fvju2nwCjD065yn@login.dkuug.dk>, Henrik Roseno wrote:
> In article <DEoujyr28zpM065yn@netcom.com>, Frank McNeil wrote:
> > In article <TE-tju2nwmGB065yn@login.dkuug.dk>, Henrik Roseno wrote:
> > >ANNOUNCEMENT of a new utility program!
> >   Thanks Henrik!
> > Question:
> > ---------
> >   It wouldn't work for me until I created a matching AREAS file.  Am I
> > doing something wrong?
>
> No.
> You are importing a SOUP-packet, which consist minimum of a *.MSG file
> and an AREAS file.
> If your reader can import an rnews-batch directly, like Yarn (using
> the appropriate option), you don't need to create an AREAS file.
      ^^^^^^^^^^^ ^^^^^^

Hello

  What is the appropriate option?  I've used 'import -r new.sou' and
it didn't work.  But then when I simply added an AREAS file and typed
'import new.sou' it did work.

  I'm using the DOS version of YARN (file date 5/15/94).

QUESTION:
--------

  What do I read to make sure I've got a rnews-batch?  I've started
reading the rnews man file and will follow that chain, but I'd rather
just read an overall authoritative description (Since that is what
Chin Huang probably conformed to when adding the 'import -r file'
feature)

  After reading SOUP12 and looking at uqwk derived SOUP messages I had
the impression that an instance of rn-batch can be a file with the
following structure. <Note 1>

  <#!rnews nn>0A      //nn is bytes in <Individual Message> plus 1
  <Individual Message>
  0A
  .
  .
  .
  <#!rnews nn>0A      //nn is bytes in <Individual Message> plus 1
  <Individual Message>
  0A

  Visual inspection with nortons disk editor confirmed that's what my
test file consisted of.  Yet 'import.exe -r new.rne' ONLY deletes the
file new.rne when launched.  However 'import.exe new.sou' also imports
the messages in new.sou.

new.rne was formed by the commands

  del new.rne
  zip new.rne 00000001.MSG

new.sou was formed by the commands

  del new.sou
  zip new.rne AREAS 00000001.MSG

Where AREAS contains of the following line

  00000001  misc.invest  un

QUESTION:
--------

  What am I doing wrong, and/or what don't I understand.

Thank you, Frank
Frank McNeil, ftmexpat@netcom.com

Note 1: from soup12:

       "A 'u' (USENET) message file is a text file consisting of one or
        more messages prefixed with an rnews header.  This header has
        the form "#! rnews n" where "n" is the number of bytes in the
        message that follows the header, excluding the line-feed
        character which terminates the header.  If the number in the
        header is followed by white space and other characters, these
        other characters should be ignored, until the terminating LF
        character is encountered."


Re: What is an rnews-batch (I nead reading material); Yarn import problem
#5915
Author: Henrik Roseno
Date: Tue, 31 May 1994 21:50
36 lines
1940 bytes
In article <23swjyr28XuP065yn@netcom.com>, Frank McNeil wrote:

[deleted alot]

> Yet 'import.exe -r new.rne' ONLY deletes the
> file new.rne when launched.  However 'import.exe new.sou' also imports
> the messages in new.sou.
> 
> new.rne was formed by the commands
> 
>   del new.rne
>   zip new.rne 00000001.MSG

This is the problem!
You should 'import -r 00000001.MSG'
I'm not really sure, but in this way all articles might go to the
'junk'-newsgroup..?

> new.sou was formed by the commands
> 
>   del new.sou
>   zip new.rne AREAS 00000001.MSG
> 
> Where AREAS contains of the following line
> 
>   00000001  misc.invest  un

In SOUP-packets articles don't go to 'junk'-newsgroup.


  Henrik
-- 
| Henrik Roseno, MSc.         |    Tel: + 45 35 36 52 76    | East or West, |
| Norrebrogade 49C, 1.tv.     |    FAX: + 45 35 26 25 93    | Cyberspace is |
| 2200 Copenhagen N - DENMARK | e-mail: hero@login.dkuug.dk | best   - HeRo |
Re: What is an rnews-batch (I nead reading material); Yarn import problem
#5916
Author: Frank McNeil
Date: Wed, 01 Jun 1994 01:58
46 lines
2524 bytes
In article <05xwju2nwaLB065yn@login.dkuug.dk>, Henrik Roseno wrote:
> In article <23swjyr28XuP065yn@netcom.com>, Frank McNeil wrote:
>
>
> This is the problem!
> You should 'import -r 00000001.MSG'
> I'm not really sure, but in this way all articles might go to the
> 'junk'-newsgroup..?

  Interesting.

> In SOUP-packets articles don't go to 'junk'-newsgroup.
>

>
>   Henrik
> --
> | Henrik Roseno, MSc.         |    Tel: + 45 35 36 52 76    | East or West, |
> | Norrebrogade 49C, 1.tv.     |    FAX: + 45 35 26 25 93    | Cyberspace is |
> | 2200 Copenhagen N - DENMARK | e-mail: hero@login.dkuug.dk | best   - HeRo |

Hello

  I just tried it.  Thanks Henrik Roseno.  I had not thought of trying
that.  I really appreciate your program and quick response to my
problem.

  I typed 'import -r taxinf.msg' and the articles went to misc.invest
where they should.  The taxinf.msg file came from a tin newsreader
thread I saved as three files, ran your program on them, and then while
using ndos typed 'copy tax_inf.* taxinf.msg'.  [Of course in the future
I'll use some form of cat files* >>rnews.msg while in Unix and then run
your program on rnews.msg].

  Well I used tin to get a new batch of articles and found that I had
to strip of a line that starts each message with 's/^From netcom*$//'.
Then everything worked O.K.  The articles were imported to the
correct news groups.

Frank

---
Frank McNeil, ftmexpat@netcom.com


Re: What is an rnews-batch (I nead reading material); Yarn import problem
#5934
Author: Russell Schulz
Date: Sun, 05 Jun 1994 20:40
13 lines
1528 bytes
um, surely this has nothing to do with dk.general?!?

ftmexpat@netcom.com (Frank McNeil) writes:

>   <#!rnews nn>0A      //nn is bytes in <Individual Message> plus 1
>   <Individual Message>
>   0A

the last 0A is aprt of the <Individual Message> -- the nn is an _exact_
byte count.
--
Russell Schulz  russell@alpha3.ersys.edmonton.ab.ca  ersys!rschulz  Shad 86c
Re: What is an rnews-batch (I nead reading material); Yarn import problem
#5952
Author: Frank McNeil
Date: Tue, 07 Jun 1994 22:41
118 lines
3695 bytes
In article <05xwju2nwaLB065yn@login.dkuug.dk>, Henrik Roseno wrote:
>In article <23swjyr28XuP065yn@netcom.com>, Frank McNeil wrote:
>
>[deleted alot]
>You should 'import -r 00000001.MSG'
>I'm not really sure, but in this way all articles might go to the
>'junk'-newsgroup..?
>
>In SOUP-packets articles don't go to 'junk'-newsgroup.
>

Hello

  I have found that article only go to the junk newsgroup of yarn when
no newsgroup exists for the article in Yarn.

  I routinely import articles to Yarn that I select and save in tin
after stripping of the top article line with a perl script that I use
in a shell script that collects saved articles and treads and downloads
them.

  Thanks Henrik and Chin.

Frank

P.S. Improvements to these scripts will be gratefully accepted.

#!/bin/csh
#Get news batches to process
#6/4/94;ftmexpat@netcom.com
rm $HOME/rnews/*.rne $HOME/rnews/*.tmp
cat $HOME/rnews/rnews* >! $HOME/rnews/xrnews.tmp
rm $HOME/rnews/rnews*
perl $HOME/bin/rnews.strip.pl  $HOME/rnews/xrnews.tmp >! $HOME/rnews/rnews.msg
zip -m $HOME/rnews/rnews.rne $HOME/rnews/rnews.msg
sz -b $HOME/rnews/rnews.rne

Ther perl script rnews.strip.pl is:
while ( <> )
{
  $_ =~  s/^From netcom.com.{0,}\n//g;
    print "$_";
}

Then when in msdos

@rem getnews.bat ; ftmexpat@netcom
@rem 06-02-94 10:23pm
@rem to import usenet and mail

SET DOWNLOAD=D:\DOWNLOAD

copy %DOWNLOAD%\*.sou %DOWNLOAD%\sou

d:
cd\yarn
SET YARN=D:\YARN
SET TZ=PST7EDT

[deleted bunch of stuff...]

:bugs1
  if exist %DOWNLOAD%\bugs.sou  goto bugs


:test1
  if exist %DOWNLOAD%\msdos.sou  goto test

[deleted bunch of stuff...]

:bugs
  SET HOME=D:\bugs
  import %DOWNLOAD%\bugs.sou
  goto test1

:test
  SET HOME=D:\test
  import %DOWNLOAD%\test.sou
  goto EXIT

:getnews
  @rem rnews.msg is the name of a previously made rn-batch
  COPY %DOWNLOAD%\rnews.msg  %DOWNLOAD%\rnews
  del %DOWNLOAD%\rnews.msg
  @rem rnews.rne is the compressed usenet packet
  unzip -j %DOWNLOAD%\rnews.rne -d %DOWNLOAD%\
  copy %DOWNLOAD%\rnews.rne %DOWNLOAD%\rnews
  del %DOWNLOAD%\rnews.rne

  cd %DOWNLOAD%\

@rem is the name of Henrik Roseno's utility

  rnews %DOWNLOAD%\rnews.msg

  cd D:\YARN
  import -r %DOWNLOAD%\rnews.msg
  goto END

:EXIT

  SET HOME=D:\text
  import %DOWNLOAD%\*.sou

@rem  get messages saved in rnews.rne

if exist %DOWNLOAD%\rnews.rne  goto getnews


:END


---
Frank McNeil, Tax Code Junkie    ftp.netcom.com:/pub/ftmexpat/*
ftmexpat@netcom.com              //nonres, expat tax refr/pgm
lynx file://netcom2.netcom.com/pub/ftmexpat/home.html (being built)

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads