Skip to content

need help with creating custom json from csv using particular fields from the source csv file #197

Answered by TomWright
oldbonez asked this question in Q&A
Discussion options

You must be logged in to vote

Dasel currently only supports a comma delimited file but I'd be happy to add a flag to change that.

If this were comma delimited the following should work:

dasel -f my_file.csv -w json -m '.(state=finished)'

This will read my_file.csv into memory with -f, allow you to select multiple records with -m, output in JSON with -w json and filter only the finished rows with the selector.

Each line of output will be a json object.

Here's a runnable example: https://dasel.tomwright.me/s/892efbcb-8c30-4cd9-b65a-44ee892b9fa2

Sorry for the delayed response. I've been pretty busy recently and not had much time to catch up.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@oldbonez
Comment options

@TomWright
Comment options

Answer selected by oldbonez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants