bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] gawk/master doesn't print when profiling


From: Hermann Peifer
Subject: [bug-gawk] gawk/master doesn't print when profiling
Date: Tue, 12 Feb 2019 18:56:21 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

Hi again,

I noticed some strange print behaviour when processing the attached
file. It looks to me that the print failure is somehow related to the
combination of processing CR line terminators and using "-p". See below.
I can't reproduce the issue with Gawk 4.2.1.

$ file NUTS_2016_20190211_162555.csv
NUTS_2016_20190211_162555.csv: UTF-8 Unicode text, with CR line terminators

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

$ gawk -V | head -1
GNU Awk 4.2.61, API: 2.0 (GNU MPFR 4.0.1, GNU MP 6.1.2)

# So far so good
$ gawk -p 'BEGIN{RS = "\r"}NR == 1' NUTS_2016_20190211_162555.csv
"Order"|"Level"|"Code"|"Parent"|"NUTS-Code"|"Description"

# "print" prints an empty line -- why?
$ gawk -p 'BEGIN{RS = "\r"}NR == 1{print}' NUTS_2016_20190211_162555.csv

# "print $0" works as expected
$ gawk -p 'BEGIN{RS = "\r"}NR == 1{print $0}' NUTS_2016_20190211_162555.csv
"Order"|"Level"|"Code"|"Parent"|"NUTS-Code"|"Description"

Attachment: NUTS_2016_20190211_162555.csv
Description: Text Data


reply via email to

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