From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 23-JUN-1993 14:52:36.52
To:	EVERHART
CC:	
Subj:	Re: Converting unix file to pure ascii

X-Newsgroups: comp.os.vms
From: markjoe@cs.ruu.nl (Mark Savenije)
Subject: Re: Converting unix file to pure ascii
Message-ID: <1993Jun23.101130.15818@cs.ruu.nl>
Date: Wed, 23 Jun 1993 10:11:30 GMT
Organization: Utrecht University, Dept. of Computer Science
Lines: 46
To: Info-VAX@KL.SRI.COM
X-Gateway-Source-Info: USENET


/* @(#) ux2vms.c $ Revision: 1 $ 18:02:33 Mon Jun 22, 1993 */

#include <stdio.h>

main(argc, argv)
int argc;
char *argv[];
{
  FILE *infile, *outfile;
  int c;

  if ((argc!=2) && (argc!=3)) {
    fprintf(stderr,"Usage: ux2vms input_file [output_file]\n");
    exit(1);
  }

  if (argc == 2) outfile = stdout; else outfile = fopen(argv[2],"w");
  if ((infile=fopen(argv[1],"r"))==NULL) {
    fprintf(stderr, "Cannot open file %s. Exiting ...\n", argv[1]);
    exit(1);
  }

  while ((c=getc(infile)) != EOF) {
    if (c==10) putc('\n', outfile); else putc(c, outfile);
  }

  fclose(infile);
  fclose(outfile);
}


Executable on request. Hope this helps. 


                                  __  __
                                 //| / //            //
                                // |/ // ___   ___  //    __  ___   ___
                               //    // ___// //   //_//  // // // //_//
                              //    // //_// //   // \\  // //_// //__
                                                      __//
-- 

                                  __  __
                                 //| / //            //
                                // |/ // ___   ___  //    __  ___   ___

