Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows Regina REXX and CR vs CRLF

88 views
Skip to first unread message

Arthur T.

unread,
Apr 23, 2021, 2:06:52 AM4/23/21
to
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.

--
Arthur T. - ar23hur "at" pobox "dot" com

Duke Normandin

unread,
Apr 23, 2021, 7:06:02 AM4/23/21
to
On Fri, 23 Apr 2021 02:06:51 -0400
Arthur T. <art...@munged.invalid> wrote:

> 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.

Those appear to be Unix-style files. I'm almost certain that there are scripts available that will do end-of-line conversion for you from the CLI - either for a few files or an entire directory.

I'm in Rexx learning mode so I cannot help you directly with a Rexx solution. I'm still trying ti figure out how to run Regina interactively in my Linux box, i.e ``regina -i''

However, I think that we might be the only two lost souls lurking this newsgroup! :)
--
Duke

Rony

unread,
Apr 23, 2021, 10:23:38 AM4/23/21
to
No, there are others lurking ...

---rony

P.S.: Indicating a line end with the CR character used to be used on the Apple platform (Unix used
LF, Windows CR-LF).

Steven Levine

unread,
Apr 23, 2021, 12:29:48 PM4/23/21
to
On Fri, 23 Apr 2021 14:23:33 UTC, Rony <rony.fl...@wu-wien.ac.at>
wrote:

Hi all,

> > However, I think that we might be the only two lost souls lurking this newsgroup! :)
> No, there are others lurking ...

By definition, lurkers lurk. :-)

Steven


--
---------------------------------------------------------------------
Steven Levine <ste...@earthlink.bogus.net>
DIY/ArcaOS/Warp etc. www.scoug.com www.arcanoae.com www.warpcave.com
---------------------------------------------------------------------

Gil Barmwater

unread,
Apr 23, 2021, 1:01:27 PM4/23/21
to
On 4/23/2021 12:29 PM, Steven Levine wrote:
> On Fri, 23 Apr 2021 14:23:33 UTC, Rony <rony.fl...@wu-wien.ac.at>
> wrote:
>
> Hi all,
>
>>> However, I think that we might be the only two lost souls lurking this newsgroup! :)
>> No, there are others lurking ...
>
> By definition, lurkers lurk. :-)
>
> Steven
>
>
And there are others...

--
Gil Barmwater

Arthur T.

unread,
Apr 23, 2021, 6:15:39 PM4/23/21
to
In Message-ID:<11p86vVJT4Oe-pn2-bi3bpyzponYx@slamain>,
"Steven Levine" <ste...@nomail.earthlink.net> wrote:

>On Fri, 23 Apr 2021 14:23:33 UTC, Rony <rony.fl...@wu-wien.ac.at>
>wrote:
>
>Hi all,
>
>> > However, I think that we might be the only two lost souls lurking this newsgroup! :)
>> No, there are others lurking ...
>
>By definition, lurkers lurk. :-)

From my quotes file. I'm not sure who said it:

> Lurkers are the only smart ones on Usenet. :-)
Why, thank you...
oh bugger

Watson

unread,
Apr 24, 2021, 6:28:04 AM4/24/21
to
I confess to being a lurker. I'm sure there are others
REXX is such an easy language, extremely powerful, and I can tolerate it not being the fastest (I just run Regina on the spare PC)
The stem & interpret features are unique, to my knowledge

Regarding the OP, I'd load the whole file then parse it into a stem, then do whatever's required
JWatson

Arthur T.

unread,
Apr 25, 2021, 8:45:51 PM4/25/21
to
In Message-ID:<afn48gl9d42ogo4hd...@4ax.com>,
Arthur T. <art...@munged.invalid> wrote:

>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.

I was just about to write my own deblocking code when I decided to
try another tack. I found a free command-line utility to convert the
.doc files to .txt, and those .txt files are delimited with CRLF and
can be easily read by REXX.

Thank you all for your suggestions. If anyone cares, I was going to
use the method I described originally as:
>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.

0 new messages