[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getnum leaks into next field
From: |
Erik Auerswald |
Subject: |
Re: getnum leaks into next field |
Date: |
Fri, 22 Nov 2024 14:36:27 +0100 |
Hi,
On Fri, Nov 22, 2024 at 12:32:48PM +0000, mousefad wrote:
>
> I love datamash - thanks for the amazing tool! I think I found a bug
> in datamash v1.8-dirty.
Thanks!
> The `getnum` operation appears to go beyond the specified field:
>
> $ cat data
> ADDRESS|BILL_DATE
> 123 Letsbe Avenue, Madeupville|2024-10-01
> The Post House, Hamleton|2024-10-14
>
> $ datamash -t "|" -H getnum 1 cut 2 < data
> getnum(ADDRESS)|cut(BILL_DATE)
> 123|2024-10-01
> 2024|2024-10-14
>
> I feel like it should not take the numerical value from the following
> field, but it appears to be doing so when no number if found in the
> specified field.
Thanks for the report. This issue is fixed in the current development
version since commit 56e2e5893df125d953765adc2851e8b0902ebf37
<https://git.savannah.gnu.org/gitweb/?p=datamash.git;a=commit;h=56e2e5893df125d953765adc2851e8b0902ebf37>
$ cat data
ADDRESS|BILL_DATE
123 Letsbe Avenue, Madeupville|2024-10-01
The Post House, Hamleton|2024-10-14
$ ./datamash -t "|" -H getnum 1 cut 2 <data
getnum(ADDRESS)|cut(BILL_DATE)
123|2024-10-01
0|2024-10-14
$ ./datamash --version | head -n1
datamash (GNU datamash) 1.8.37-56e2
Best regards,
Erik