[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Eli Zaretskii
Subject: Re: BINMODE and PCs
Date: Wed, 27 Nov 2002 20:03:45 +0300

> From: "Bill Brown" <address@hidden>
> Date: Wed, 27 Nov 2002 09:34:06 -0500
> According to documentation of 3.1.1 and later, <gawk -v BINMODE="r" -v
> RS="\r" ...> should allow DOS text files to come in unaltered with the
> record separator set to "\r"=0x0D=\015=CR. A DOS text file that has lines
> delimited with 0x0D (CR only) gets read in as one huge record. I am running
> gawk 3.0.4 in a DOs window under WIN98. My call is:
>         gawk -v BINMODE="r"   -v RS="\r"  -f tst.awk   tst.txt

BINMODE was introduced in Gawk 3.1.0, so obviously version 3.0.4 does
not support it.

> BUT if I read the file with WordPad and save it, <gawk -f tst.awk tst.txt>
> work as expected.   Seems as if gawk is throwing way the CR character?

Yes, DOS programs that use text I/O for reading files remove lone CR
characters from the file.  Gawk is one of those programs.

> Is this a bug or user error? I really need to process the CR delimited file
> directly.

Upgrade to a port of Gawk 3.1.x, then you will be able to use BINMODE
to do that.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]