[
{
"id": "ABS",
"name": "Australian Bureau of Statistics"
},
{
"id": "ECB",
"name": "European Central Bank"
},
{
"id": "ESTAT",
"name": "Eurostat"
},
{
"id": "ILO",
"name": "International Labor Organization"
}
]
$ cat test.json | dasel -r json -w csv (base)
Error: could not write output: could not write to output file: could not get byte data for file: CSVParser.toBytes cannot handle type []interface {}
Usage:
dasel select -f <file> -p <json,yaml> -s <selector> [flags]
Flags:
-c, --compact Compact the output by removing all pretty-printing where possible.
-f, --file string The file to query.
-h, --help help for select
--length Output the length of the selected value.
-m, --multiple Select multiple results.
-n, --null Output null instead of value not found errors.
-p, --parser string Shorthand for -r FORMAT -w FORMAT.
--plain Alias of -w plain
-r, --read string The parser to use when reading.
-s, --selector string The selector to use when querying the data structure.
-w, --write string The parser to use when writing.
Error: could not write output: could not write to output file: could not get byte data for file: CSVParser.toBytes cannot handle type []interface {}
I then tried some slight modifications. Running cat test.json | dasel -p json -w csv ".[*]"
gets: Error: could not query node: could not find value: selector is not supported here: .[*]
map[id:ABS name:Australian Bureau of Statistics]
map[id:ECB name:European Central Bank]
map[id:ESTAT name:Eurostat]
map[id:ILO name:International Labor Organization]
which is better, but it should be comma separated values.
Please let me know if I can provide any more information. Thanks for this great project!