From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 25-FEB-1991 11:31:06.59
To:	ARISIA::EVERHART
CC:	
Subj:	re (2) : PSI logfiles

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.83)
	 id AA08648; Mon, 25 Feb 91 11:13:53 EST
Message-Id:  <9102251613.AA08648@crdgw1.ge.com>
Received: From CUNYVM.CUNY.EDU by CRVAX.SRI.COM with TCP; Mon, 25 FEB 91 06:11:24 PST
Received: from FRONI51.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.2MX) with BSMTP id 5812; Mon, 25 Feb 91 09:11:44 EST
Date: 25 FEB 91 15:03:59.67-GMT
From: ONETO%FRONI51.BITNET@CUNYVM.CUNY.EDU
Subject: re (2) : PSI logfiles
To: INFO-VAX@KL.SRI.COM

Date sent:  25-FEB-1991 13:49:21 GMT

        Hi Net !
        Don Stokes <GPWRDCS@gp.co.nz>, in answer to
<1lendl@edvz.uni-salzburg.ada.at>, wrote :
>>I've got problems with the PSI logfiles.
>>When I connect to mailboxes or other hosts via X.25 I issue the
>>set host command with the /log qualifier to get a log of the session.
>>( i.e. $ SET HOST/X29/LOG=mbox.log xxxxx  )
>>
>>When I use "TYPE" to cat the logfile to the terminal everything seems okay,
>>but if I want to edit it, I notice that the file is NOT okay. There are some
>>fuzzy characters in it, the line-termination isn't okay, ...
>>
[...]
        I ran against this very same problem, and after playing around
with FDL, CONVERT and other niceties, I finally wrote the following
little program to filter the garbage characters out... I'm glad to share
it with the net... Of course, standard disclaimer applies, but I will
accept any improvement !
(for example, I've plan to take parameters froms the command line, with
default extensions, to convert it to VAX-C... but there is only 24 hour
a day, and may be sometimes less !)
-------------------- start of readpsi.pas --------------------
program readpsi (input, output);

const
  titre    = 'Filtrage de Fichiers recus par Transpac, sous VAX/VMS';
  version  = 'Version 0.02 du 14-JAN-1989';
  auteur   = 'Jean-Louis Oneto';

type
  name     = varying [80] of char;
  fichier  = text;

var
  source                  : fichier;
  dest                    : fichier;
  source_name, dest_name  : name;
  i                       : integer;
  ii                      : integer;
  car_in                  : char;
  car_out                 : char;
  caract                  : char;

procedure next_in;
  begin
    if eoln (source) then
      readln (source);
    if not eof (source) then
      begin
        read (source,car_in);
        car_in := chr (uand(ord (car_in), 127));
      end
    else
      car_in := ''(00);
  end;

procedure next_out;
  begin
    write (dest,car_out);
  end;

$programme principal
  begin
    $initialisation
    writeln (titre);
    writeln (Version);
    writeln (auteur);
    write ('Input filename  : ');
    readln (source_name);
    open (file_variable := source,
         file_name := source_name,
         history := readonly,
         access_method := sequential,
         record_type := variable);
    reset (source);
    write ('Output filename : ');
    readln (dest_name);
    open (file_variable := dest,
         file_name := dest_name,
         history := new,
         access_method := sequential,
         record_type := variable);
    rewrite (dest);
    while not eof (source) do
      begin
        next_in;
        case car_in of
          ''(00)..''(06) : ; $ignore ^@..^F
          ''(10)..''(11) : ; $ignore ^J..^K
          ''(13)         : writeln (dest);
          ''(14)..''(26) : ; $ignore ^N..^Z
          ''(27)         : writeln (dest); $remplace ESC par EOLN
          ''(28)..''(31) : ; $ignore ^\..^_
          ''(127)        : ; $ignore <DEL>
        otherwise
          begin
            car_out := car_in;
            next_out;
          end;
        end;
      end;
    close (source); close (dest);
end.
-------------------- end   of readpsi.pas --------------------
        Jean-Louis Oneto
        OCA-CERGA, Avenue Copernic, 06130 Grasse - FRANCE
Bitnet : ONETO@FRONI51          SPAN : OCAR01::ONETO (17494::ONETO)
Transpac : PSI%0208006149913::ONETO / 106149913::ONETO

