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:

# block comments don't come through
person: # neither do comments on maps
name: Mike # comments on values appear
- cat # comments on array values appear
food: [pizza] # comments on arrays do not


yq eval -o=p sample.yaml

will output:

# comments on values appear = Mike
# comments on array values appear
person.pets.0 = cat = pizza