yaml multi document markers #237
Answered
by
TomWright
electriquo
asked this question in
Q&A
-
|
How to select specific YAML document markers? For example, ---
foo: bar
---
foo: baz
---
foo: spamHow to tell |
Beta Was this translation helpful? Give feedback.
Answered by
TomWright
Jul 12, 2022
Replies: 2 comments 5 replies
-
|
When reading multiple documents dasel stores them internally as a list, allowing you to access them as follows: $ echo '---
foo: bar
---
foo: baz
---
foo: spam' | dasel -r yaml '.[1].foo'
baz |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
electriquo
-
|
@TomWright I'm trying to do the same with v3 but get Is there a way to achieve the same in v3? My use case is: iterating through a multi-document yaml and outputting each doc to a separate file. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When reading multiple documents dasel stores them internally as a list, allowing you to access them as follows: