bug-datamash
[Top][All Lists]
Advanced

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

[Bug-datamash] Output field separator switch?


From: Dave Myron
Subject: [Bug-datamash] Output field separator switch?
Date: Wed, 30 Aug 2017 17:06:59 -0700

I'm late to the game discovering GNU datamash but it's fantastic! 

One thing I've found strange is that passing in the field separator also impacts the output. 

For example, with a CSV file I, obviously, give -t, but that also causes datamash to print its output with a comma separator. This is surprising to me.

$ datamash -sHt, -g5,6,7,8 count 1 < myfile
GroupBy("delivered"),GroupBy("clicked"),GroupBy("control_persistent"),GroupBy("control_campaign"),count("subscriber_id")
"N","N","N","N",180352
"N","N","N","Y",1199
"N","N","Y","N",802
"N","N","Y","Y",68
"U","N","N","N",52269
"U","Y","N","N",392
"Y","N","N","N",337929
"Y","Y","N","N",17515

Ideally, it'd still print out "normally", ala:

GroupBy("delivered") GroupBy("clicked") GroupBy("control_persistent") GroupBy("control_campaign") count("subscriber_id")
"N" "N" "N" "N" 180352
"N" "N" "N" "Y" 1199
"N" "N" "Y" "N" 802
"N" "N" "Y" "Y" 68
"U" "N" "N" "N" 52269
"U" "Y" "N" "N" 392
"Y" "N" "N" "N" 337929
"Y" "Y" "N" "N" 17515

Of course, I can "fix it" by piping the result into column -s, -t and get things nicely laid out again.

Would it be possible to get a separate output field separator switch?

Thanks,
Dave Myron

reply via email to

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