Skip to content

Get fields from an array of objects of a json input #80

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

You must be logged in to vote

To do this you should use the any index selector in combination with the multi flag.

The full selector looks like:

.items.[*].kind

Here's an example on the playground: https://dasel.tomwright.me/s/d6f56db3-bc64-4f3f-9529-f617e6483dcc

The full command will look like this:

dasel -f o.json -m '.items.[*].kind'

If you don't want the resulting lines to be quoted you can use the --plain flag.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@ifraixedes
Comment options

Comment options

You must be logged in to vote
5 replies
@TomWright
Comment options

@ifraixedes
Comment options

@TomWright
Comment options

@ifraixedes
Comment options

@tallgrrl
Comment options

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

This discussion was converted from issue #80 on December 28, 2020 11:13.