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

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


reply via email to

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