Skip to content

Read a YAML file to a string #1336

Answered by julianbarg
hjiajing asked this question in Q&A
Discussion options

You must be logged in to vote

Since yq's output is already a string, you can do any kind of conversion you want on that output. Would this work for you?

yq '.' file.yaml | awk '{printf "%s\\n", $0}'

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

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

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

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