[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: |
david kerns |
Subject: |
Re: [bug-gawk] Count empty line as a column with one empty field |
Date: |
Tue, 25 Sep 2018 07:43:13 -0700 |
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
>>
>>
>