Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Computers are not intelligent. They only think they are.


devel / comp.lang.awk / (OT) Response to "Mack", in re: Input Parser to handle DOS text files

SubjectAuthor
o (OT) Response to "Mack", in re: Input Parser to handle DOS text filesKenny McCormack

1
(OT) Response to "Mack", in re: Input Parser to handle DOS text files

<se6sbj$9d40$2@news.xmission.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=837&group=comp.lang.awk#837

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.awk
Subject: (OT) Response to "Mack", in re: Input Parser to handle DOS text files
Date: Sun, 1 Aug 2021 19:23:31 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <se6sbj$9d40$2@news.xmission.com>
Injection-Date: Sun, 1 Aug 2021 19:23:31 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="308352"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sun, 1 Aug 2021 19:23 UTC

Mack wrote:
>This is a lot of work to do what
>
> BEGIN { RS = "\r?\n" }
>
>would do. Even simpler would be to put
>
> tr -d '\r'
>
>as a stage in your pipleine before calling gawk.
>
>Mack

A few comments:
1) As noted, I don't like changing RS. So, for me, I was looking for
something better. Note also that if you actually want to do something
fancy with RS (other than fixing the DOS line terminator problem), then
it is nice to not have to do both in RS.
2) I have also used the "tr -d" method; again, not a good overall fit to my
development ecosystem.
3) The C source code looks more complicated than it is. In fact, only a
few lines of it are non-boilerplate. Once you've done one, it is
pretty easy to write new ones. In fact, I only spent about 15 minutes
changing the previous Input Parser to generate the new one. All you
need to do is one global-search-and-replace to change all the names and
then you write a few (about 10) lines of new code to do what you want
it to do.

Anyway, it is what it is. Use it or don't use it. Makes no difference to me.

--
Just for a change of pace, this sig is *not* an obscure reference to
comp.lang.c...

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor