Skip to content

flatten array of maps to create tsv format #2370

Answered by jandubois
ckuenne asked this question in Q&A
Discussion options

You must be logged in to vote

If you want just this specific operation and not a generic flattening, you can just pick the fields yourself instead of using pick:

yq -o tsv '.[] |= {"name":.name, "email":.email, "username":.user_metadata.username}' test.yml
name	email	username
Miller, Tim	Tim.Miller@xy.com	tmiller
Jones, Karen	Karen.Jones@z.com	kjones

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mikefarah
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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
Converted from issue

This discussion was converted from issue #2271 on May 14, 2025 11:31.