• Windows Regina REXX and CR vs CRLF

    From Arthur T.@21:1/5 to All on Fri Apr 23 02:06:51 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Duke Normandin@21:1/5 to Arthur T. on Fri Apr 23 05:05:59 2021
    On Fri, 23 Apr 2021 02:06:51 -0400
    Arthur T. <arthur@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rony@21:1/5 to Duke Normandin on Fri Apr 23 16:23:33 2021
    On 23.04.2021 13:05, Duke Normandin wrote:
    On Fri, 23 Apr 2021 02:06:51 -0400
    Arthur T. <arthur@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! :)


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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven Levine@21:1/5 to All on Fri Apr 23 11:29:42 2021
    On Fri, 23 Apr 2021 14:23:33 UTC, Rony <rony.flatscher@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 <steve53@earthlink.bogus.net>
    DIY/ArcaOS/Warp etc. www.scoug.com www.arcanoae.com www.warpcave.com ---------------------------------------------------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gil Barmwater@21:1/5 to Steven Levine on Fri Apr 23 13:01:37 2021
    On 4/23/2021 12:29 PM, Steven Levine wrote:
    On Fri, 23 Apr 2021 14:23:33 UTC, Rony <rony.flatscher@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arthur T.@21:1/5 to Steven Levine on Fri Apr 23 18:15:39 2021
    In Message-ID:<11p86vVJT4Oe-pn2-bi3bpyzponYx@slamain>,
    "Steven Levine" <steve53@nomail.earthlink.net> wrote:

    On Fri, 23 Apr 2021 14:23:33 UTC, Rony <rony.flatscher@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


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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Watson@21:1/5 to Steven Levine on Sat Apr 24 03:28:03 2021
    On Friday, 23 April 2021 at 17:29:48 UTC+1, 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


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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arthur T.@21:1/5 to Arthur T. on Sun Apr 25 20:45:49 2021
    In Message-ID:<afn48gl9d42ogo4hde6nq3li9tbinunjr0@4ax.com>,
    Arthur T. <arthur@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.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)