Select, put and delete data from JSON, TOML, YAML, XML and CSV files
1–10 of 34 posts
Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#2Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#3Combined with yj[2] you can also get TOML and HCL support, but not CSV.
It's certainly not because there's a lack of these tools :p
Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#4Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#5Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#6Can this or anything else flatten arrays of JSON objects to CSV?
Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#7Can this or anything else flatten arrays of JSON objects to CSV?
What exactly is the "transformation" you envision?
Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#8The "delete" example on the readme is a bit odd, since it seems to suggest that you need to specify the value to delete as well as the path. The equivalent in the documentation does not have this problem.
> echo '{"name": "Tom"}' | dasel -p json '.name'
Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#9Can this or anything else flatten arrays of JSON objects to CSV?
then just call to_csv() on the dataframe. (edited to add to comment on exporting to CSV as per the original question).
Re: Select, put and delete data from JSON, TOML, YAML, XML and CSV files
#10Can this or anything else flatten arrays of JSON objects to CSV?
Of course you can do it with http://brackit.io . What exactly is the "transformation" you envision?
let $array := [{"foo":0,"bar":"tztz"},{"foo":"hello","bar":null},{"foo":true,"bar":"yes"}]
let $value := for $object in $array
return
let $fields := bit:fields($object)
let $len := bit:len($fields)
for $field at $pos in $fields
return if ($pos $field || ","
) else (
$object=>$field || "\n"
)
return string-join($value,"")
will output: 0,tztz
hello,null
true,yes