Skip to content
Discussion options

You must be logged in to vote

This caused by an annoying existing issue in the underlying go-yaml parser whereby if there are any trailing spaces before the newline character, then the entire string is printed in double quotes (see go-yaml/yaml#880)

Luckily, you can use the sub operator to fix this on the fly:

yq '.view.query |= sub(" *\n", "\n")' file.json -oy

Replies: 1 comment 1 reply

Comment options

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

Answer selected by msgongora
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