bug-datamash
[Top][All Lists]
Advanced

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

Re: Different delimiter for 'collapse'


From: Erik Auerswald
Subject: Re: Different delimiter for 'collapse'
Date: Sun, 14 Feb 2021 15:10:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi,

On 13.02.21 22:00, Erik Auerswald wrote:
On 13.02.21 18:14, Eric Powell wrote:
Datamash is such a wonderful piece of software and I am so happy to have
discovered it.
One feature that I wish was available is to change the delimiter for the
collapse operation.  My data has commas in it already so I cannot
distinguish between those and the commas produced by collapse.  It would be
great if there was a command-line flag allowing the user to choose the
delimiter used by collapse.

I second this.  It is often useful and convenient to be able to
choose input and/or output separators.  Many programs allow to
specify those via options.  It would be nice for datamash to
have such options, too.

I'd say a way to change the value delimiter in comma-separated value
output is needed functionality inside of datamash, because of locale
differences.  For example, in the German locale, comma is used for
decimal numbers:

    $ echo $LC_NUMERIC
    de_DE.UTF-8
    $ printf -- '%.1f\n' 1,1 1,2 1,3 | datamash sum 1
    3,6
    $ printf -- '%.1f\n' 1,1 1,2 1,3 | datamash collapse 1
    1,1,1,2,1,3
    $ printf -- '%.1f\n' 1,1 1,2 1,3 1,1 | datamash unique 1
    1,1,1,2,1,3

To operate on decimal numbers, comma needs to be part of the input
data.  To use the unique or collapse commands with decimal numbers
with the German locale and still have useful results, a csv
delimiter different from comma is needed.  Pre and post processing
with tr is not a sufficient replacement.  Thus I'd say that it is
more than just convenient to have a way to change the value
delimiter in comma-separated value output.

Thanks,
Erik



reply via email to

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