Skip to content

Read a YAML file to a string #1336

Answered by julianbarg
hjiajing asked this question in Q&A
Sep 14, 2022 · 3 comments · 2 replies

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 2 replies

You must be logged in to vote
0 replies

You must be logged in to vote
1 reply
@gswallow

Answer selected by hjiajing

You must be logged in to vote
1 reply
@hjiajing

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