bug-gawk
[Top][All Lists]
Advanced

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

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


From: arnold
Subject: Re: [bug-gawk] gawk/master doesn't print when profiling
Date: Tue, 12 Feb 2019 12:31:11 -0700
User-agent: Heirloom mailx 12.5 7/5/10

After turning \n into \r in the attachment, I can reproduce this. I note
that without -p the 2nd version does work.

This is weird, since the byte code for all three is the same! (At least
according to the dump from the debugger.)

I will try to track it down.

Thanks for the report.

Arnold

Hermann Peifer <address@hidden> wrote:

> 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"



reply via email to

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