Column
Last updated
Returns the column of the matching node. Starts from 1, 0 indicates there was no column data.
Column is the number of characters that precede that node on the line it starts.
Given a sample.yml file of:
a: cat
b: bobthen
yq '.b | column' sample.ymlwill output
4Pipe through the key operator to get the column of the key
Given a sample.yml file of:
a: cat
b: bobthen
will output
Given a sample.yml file of:
then
will output
Running
will output
Last updated
yq '.b | key | column' sample.yml1a: catyq '.a | key | column' sample.yml1yq --null-input '{"a": "new entry"} | column'0