home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / inetlog3.zip / eof2crlf.cmd next >
OS/2 REXX Batch file  |  1995-03-18  |  510b  |  22 lines

  1. /* EOF2CRLF.CMD         Jerry Levy    18 Mar 95    */
  2. /* Replaces E-O-F's (26 decimal or 1A hex or Control-Z)    */
  3. /* by a carriage return+linefeed                */
  4. /* Syntax:                            */
  5. /*    eof2crlf inputfile outputfile                */
  6.  
  7.  
  8. EOF = d2c(26)
  9. CR = d2c(13)
  10. LF = d2c(10)
  11.  
  12. Arg InputFile OutputFile
  13. do while Chars(InputFile) > 0
  14.    DataChar = CharIn(InputFile)
  15.    if DataChar = EOF then
  16.    do
  17.       DataChar = CR
  18.       call CharOut OutputFile, DataChar
  19.       DataChar = LF
  20.    end
  21.    call CharOut OutputFile, DataChar
  22. end