yq
yq copied to clipboard
Sort Keys reverse
I wish I could use yq to sort keys by reverse order. There's already a sort keys that sort only in one direction.
Note:
- how to questions should be posted in the discussion board and not raised as an issue.
- V3 will no longer have any enhancements.
Describe the solution you'd like If we have data1.yml like: (please keep to around 10 lines )
a: a
b: b
c: c
And we run a command:
yq 'sort_keys(.) | reverse' test.yml
it could output
c: c
b: b
a: a