how to get a plain output #283
-
Dasel v1 supports the $ dasel --version
dasel version 2.0.2
$ echo '{"tags": ["foo","bar"]}' | dasel -r json '.tags.all()'
"foo"
"bar" How can I make Dasel return the values without the quotes? For instance, if $ echo '{"tags": ["foo","bar"]}' | dasel -r json '.tags.all()' --plain
foo
bar Tried to utilize the csv output to get the plain values, but got an error $ echo '{"tags": ["foo","bar"]}' | dasel -r json '.tags.all()' -w csv
Error: CSVParser.toBytes cannot handle type string Switching to yml output seems to do well for some values (but observe the inconsistency in the output) $ echo '{"tags": ["foo","bar", "1.1", "*"]}' | dasel -r json '.tags.all()' -w yml
foo
bar
"1.1"
'*' If there is a better selector for getting all values in plain form, please enlighten me :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That should be Your CSV problem is because of the You're passing a list of strings with no context to the csv parser. |
Beta Was this translation helpful? Give feedback.
That should be
-w -
. Looks like I missed it from the docs... Sorry about thatYour CSV problem is because of the
all()
selector.You're passing a list of strings with no context to the csv parser.
The csv parser expects an array. You can achieve this by using
merge
or removingall
.