How can i use yaml::read_yaml()
to produce a true toplevel OR convert the current nested list.
Simple regex
<code> yaml::read_yaml(text = "
BOB:
anotherBOB:
- abcd
JOHN:
notBOB:
- zyx
")
</code>
<code> yaml::read_yaml(text = "
BOB:
anotherBOB:
- abcd
JOHN:
notBOB:
- zyx
")
</code>
yaml::read_yaml(text = "
BOB:
anotherBOB:
- abcd
JOHN:
notBOB:
- zyx
")
yields:
<code>$BOB
$BOB$anotherBOB
[1] "abcd"
$JOHN
$JOHN$notBOB
[1] "zyx"
</code>
<code>$BOB
$BOB$anotherBOB
[1] "abcd"
$JOHN
$JOHN$notBOB
[1] "zyx"
</code>
$BOB
$BOB$anotherBOB
[1] "abcd"
$JOHN
$JOHN$notBOB
[1] "zyx"
My final output should look as such
<code>BOB
BOB$anotherBOB
[1] "abcd"
JOHN
JOHN$notBOB
[1] "zyx"
</code>
<code>BOB
BOB$anotherBOB
[1] "abcd"
JOHN
JOHN$notBOB
[1] "zyx"
</code>
BOB
BOB$anotherBOB
[1] "abcd"
JOHN
JOHN$notBOB
[1] "zyx"
1