miller
miller copied to clipboard
--quote-all silently ignored
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):
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:
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"
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
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 ...
@dimitri-lenkov restored in #1084