1

I receive a file from internet, and the lines are separated by 0x0D char I display it using this tool

https://www.fileformat.info/tool/hexdump.htm

When I read that file into Rexx using "linein()", all the file comes into one sigle line. Obviously linein() works fine when file has 0x0D0A as End Of Line char.

How do I specify to Rexx to split lines using 0x0D char instead of 0x0D0A ?

Dave
  • 5,108
  • 16
  • 30
  • 40
Sebastia.Net
  • 129
  • 2
  • 14

1 Answers1

1

Apart from getting the file sent to you with proper CRLF record markers for Windows instead of the LF used in Unix-like systems there are a couple of ways of splitting the data - but neither will read the file a record at a time but will extract each record from the long string read in. 1 - Use WORDPOS to find the position of the LF and SUBSTR to remove that the record 2 - Use PARSE to split the data at the LF position

One way to read one record at a time is to use CHARIN to read a byte at a time until it encounters the LF.

NicC
  • 293
  • 1
  • 6