bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Count empty line as a column with one empty field


From: Peng Yu
Subject: Re: [bug-gawk] Count empty line as a column with one empty field
Date: Tue, 25 Sep 2018 09:47:09 -0500

I am not saying it is a bug, either.

A row with an empty field, instead of an empty row, is just another
way to interpret in the input. Both are fine depending on the context.
In certain cases, the former may be preferred over the latter.

On Tue, Sep 25, 2018 at 9:43 AM, david kerns <address@hidden> wrote:
> sorry, I meant to imply: "no awk bug"
>
> On Tue, Sep 25, 2018 at 7:39 AM, david kerns <address@hidden>
> wrote:
>>
>> me too ...
>>
>> $ printf '%s\n' a '' b
>> a
>>
>> b
>> $ printf '%s\n' a '' b | awk -e '{print $0, NF}'
>> a 1
>>  0
>> b 1
>>
>>
>>
>> On Tue, Sep 25, 2018 at 7:33 AM, Peng Yu <address@hidden> wrote:
>>>
>>> Hi,
>>>
>>> I see this.
>>>
>>> $ printf '%s\n' a '' b | awk -e '{print NF}'
>>> 1
>>> 0
>>> 1
>>>
>>> Is it possible to consider the empty line to contain one empty field
>>> instead of no fields?
>>>
>>> --
>>> Regards,
>>> Peng
>>>
>>
>



-- 
Regards,
Peng



reply via email to

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