Working with TOML

Decode from TOML. Note that yq does not yet support outputting in TOML format (and therefore it cannot roundtrip)

Parse: Simple

Given a sample.toml file of:

A = "hello"
B = 12

then

yq -oy '.' sample.toml

will output

A: hello
B: 12

Parse: Deep paths

Given a sample.toml file of:

person.name = "hello"
person.address = "12 cat st"

then

will output

Encode: Scalar

Given a sample.toml file of:

then

will output

Parse: inline table

Given a sample.toml file of:

then

will output

Parse: Array Table

Given a sample.toml file of:

then

will output

Parse: Array of Array Table

Given a sample.toml file of:

then

will output

Parse: Empty Table

Given a sample.toml file of:

then

will output

Last updated

Was this helpful?