y
y
yq
Search…
Working with Properties

Yaml to Properties

To convert to property file format, use --outputformat=props or -o=p. Porting the comments from the yaml file to the property file is still in progress, currently line comments on the node values will be copied across.
Given a sample file of:
1
# block comments don't come through
2
person: # neither do comments on maps
3
name: Mike # comments on values appear
4
pets:
5
- cat # comments on array values appear
6
food: [pizza] # comments on arrays do not
Copied!
then
1
yq eval -o=p sample.yaml
Copied!
will output:
1
# comments on values appear
2
person.name = Mike
3
4
# comments on array values appear
5
person.pets.0 = cat
6
person.food.0 = pizza
Copied!
Last modified 29d ago
Copy link