miller icon indicating copy to clipboard operation
miller copied to clipboard

--quote-all silently ignored

Open dimitri-lenkov opened this issue 2 years ago • 3 comments

The latest version of mlr broke a script of mine and was wondering if there is a new flag for this, or if I should be using a different tool for this use case (I need quoted CSV output).

I've narrowed down my problem to this flag (I think):

this1

Previous versions of mlr would output the following:

λ echo "test,foo" | mlr --csv --quote-all -N unsparsify
"test","foo"

And now that the --quote-all flag is ignored, I get this output instead:

λ echo "test,foo" | mlr --csv --quote-all -N unsparsify
test,foo

In the docs:

https://miller.readthedocs.io/en/latest/reference-main-flag-list/#legacy-flags

It states at the top of that section:

They are accepted as no-op flags in order to keep old scripts from breaking.

But it did break my script, just in a confusing way lol. My use-case is updating a configuration file that only accepts quoted CSV data.

Thanks for the project & any advice :v:

dimitri-lenkov avatar May 21 '22 15:05 dimitri-lenkov

I'm just patching my script like this in the meantime:

λ echo 'test,foo' | mlr --c2t -N unsparsify | xargs -I{} echo '"{}"' | sed 's/\t/\",\"/g'
"test","foo"

dimitri-lenkov avatar May 21 '22 16:05 dimitri-lenkov

Another solution, is to have in you PC both version 5 & 6, and then use the 5 for this part of your workflow

echo 'test,foo' | mlr5 --csv --quote-all -N unsparsify

aborruso avatar May 22 '22 07:05 aborruso

Hi @dimitri-lenkov and sorry for the disruption! :(

Let me look into this -- I'm using the Go CSV library now in Miller 6 where I don't have as many 'knobs' to turn as I used to. There may be a good way to handle this, though ...

johnkerl avatar Jun 03 '22 18:06 johnkerl

@dimitri-lenkov restored in #1084

johnkerl avatar Aug 22 '22 13:08 johnkerl