[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Field changed to numeric in assignment when Arbitrary-Precision (-M)
From: |
arnold |
Subject: |
Re: Field changed to numeric in assignment when Arbitrary-Precision (-M) is on |
Date: |
Sun, 27 Jun 2021 09:31:01 -0600 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
Hi.
This is fixed in my current code base. I am working on making a release,
which I hope will happen soon. If it's a problem for you now, you can
build from git, using the gawk-5.1-stable branch.
Thanks!
Arnold
Jin Chen <chen@jins.email> wrote:
> Hi,
>
> When enable the arbitrary precision arithmetic with gawk, it apparently
> alters field's type into numeric during comparision. This has impact on
> following assignment. The data file and awk file are listed at the end
> of this email.
>
> >gawk -M -f ./verify.awk data.csv
> 0,r1f1,r1f2
> 0,r2f1,r2f2
>
> while
> >gawk -f ./verify.awk data.csv
> r1f1,r1f1,r1f2
> r2f1,r2f1,r2f2
>
> Below is the awk file and data file.
>
> verify.awk:
> ---------------
> BEGIN { FS=","; OFS=","; }
>
> { "test" == $1
> field1 = $1
> field2 = $2
> print field1,$1,field2
> }
>
> data.csv:
> --------
> r1f1,r1f2
> r2f1,r2f2
>
>
> My gawk version is
>
> GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
> Copyright (C) 1989, 1991-2020 Free Software Foundation.
>
> My OS is
>
> Arch Linux
> Linux 5.10.24-1-lts #1 SMP Wed, 17 Mar 2021 16:53:52 +0000 x86_64
> GNU/Linux
>
> Regards,
>
> Jin