bug-gnu-utils
[Top][All Lists]
Advanced

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

BINMODE and PCs


From: Bill Brown
Subject: BINMODE and PCs
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
 
tst.awk: { print }
tst.txt: ASCII file with 9140 lines 550KB
 
When I end, I have RN==1 and $0 is the entire file???
 
I've tried BINMODE=1 (see Using gawk on PC Operating Systems) - same result. Tried setting BINMODE and RS in BEGIN - same result.
 
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?
 
Is this a bug or user error? I really need to process the CR delimited file directly.
 
Thanks
 

reply via email to

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