bug-datamash
[Top][All Lists]
Advanced

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

Re: [PATCH] Fixed incomplete and incorrect treatment of comments and tra


From: Tim Rice
Subject: Re: [PATCH] Fixed incomplete and incorrect treatment of comments and trailing whitespace
Date: Sun, 29 May 2022 01:41:55 +0000

Hey Erik,

Awesome analysis. I hadn't realized that Datamash would snip the first field 
when using -W, and I agree it should be consistent.

My personal inclination is to prefer allowing whitespace to delimit both the 
first and last field, i.e. stop ignoring a leading space. In my mind, this is 
the more intuitive interpretation of what whitespace delimiting should mean.

On the other hand, it sounds like compatibility with other tools means both should be ignored. And 
I am okay with that too. Anyone who does need empty fields with whitespace delimiters is probably 
already using a convention like "NA" or "-" instead of just leaving the field 
blank.

I wonder if an extra flag (--ignore-terminal-space or so) to toggle the 
behavior might be justified. Probably not.

Given that the behavior has been in Datamash since 2016/2017, I also wonder if 
we should just leave it alone, to avoid breaking someone's scripts. Another 
option: Datamash could try to detect when the odd behavior is being used, and 
print a deprecation warning? Then wait until v2.1 before changing it.

The lowest hanging fruit here is to make sure the documentation describes the 
current behavior. I don't think I'll get it done today, but I've added it to my 
todo list.

~ Tim



reply via email to

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