Skip to content


"Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package." -

Example usage

Restructure a pagerduty csv

Download the csv using this shell function that uses BSD (macOS) date and open:

pagerduty-csv-download() {
  past="$(date -v-7d "+%FT%T")"
  present="$(date "+%FT%T")"
  open "$(date "+${past}&until=${present}&time_zone=${TZ}")"

Then restructure it using --format to interpolate variables into a template string:

dasel -f incidents.csv -w json -m --format '{{ .created_on }}{{ .id }} {{ .description }}' '.[*]'

The output will be something like:

2022-02-02T20:02:02-08:00 [FIRING:1] TargetDown (cat-downloader)

Pretty format a gpx file

This is useful for comparing two files, for instance where one may have been appended, and you need to make sure.

dasel -r xml -f 2022-01-02-18-20-00.gpx > old.gpx

Keep in mind though that pretty-formatted gpx files take up significantly more space. dasel does not appear capable of compact -c formatting xml, though there is an issue requesting it.