Arthur T.
2021-04-23 06:06:51 UTC
I'm using Regina REXX on Windows, and I'd like to read a file
linewise, but the input lines are delimited with CR (x'0d') rather
than the Windows standard of CRLF (x'0d0a'). These are old-fashioned
Word (.doc) files - about 200 of them.
Is there an easy way to do this, or am I going to have to do
character I/O and separate the lines myself? BTW, I usually use
RegStemRead for input, but I can fall back to linein if that can be
made to work.
Possible ways I'll proceed if there isn't an easy way:
I could charin the entire file, changestr all x'0d' to x'0d0a', write
to a temp file, and read the temp file by lines. It wouldn't be
difficult to code, but it offends my sense of elegance, even though
the files are small enough to make it possible.
I could charin the entire file (to variable name filein), and do my
own deblocking by an iterative, fancied-up version of PARSE VAR
FILEIN LINEIN (CR) FILEIN. This at least gets rid of the need to
write and read a temp file.
linewise, but the input lines are delimited with CR (x'0d') rather
than the Windows standard of CRLF (x'0d0a'). These are old-fashioned
Word (.doc) files - about 200 of them.
Is there an easy way to do this, or am I going to have to do
character I/O and separate the lines myself? BTW, I usually use
RegStemRead for input, but I can fall back to linein if that can be
made to work.
Possible ways I'll proceed if there isn't an easy way:
I could charin the entire file, changestr all x'0d' to x'0d0a', write
to a temp file, and read the temp file by lines. It wouldn't be
difficult to code, but it offends my sense of elegance, even though
the files are small enough to make it possible.
I could charin the entire file (to variable name filein), and do my
own deblocking by an iterative, fancied-up version of PARSE VAR
FILEIN LINEIN (CR) FILEIN. This at least gets rid of the need to
write and read a temp file.
--
Arthur T. - ar23hur "at" pobox "dot" com
Arthur T. - ar23hur "at" pobox "dot" com