You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes there are integers encoded as strings (because, sigh) and it would be nice to be able to parse them dynamically for things like sorting.
Describe the solution you'd like
If we have data1.yml like:
(please keep to around 10 lines )
- version: "10"
- version: "9"
- version: "11"
And we run a command:
yq 'sort_by(.version | parseint)'
it could output
- version: "9"
- version: "10"
- version: "11"
Describe alternatives you've considered
I tried adding a 0 to try to force integer evaluation to no avail.
Additional context
Generally being able to change the data type of a field while processing would be useful. Is this already available in some way I haven't found?
The text was updated successfully, but these errors were encountered:
Please describe your feature request.
Sometimes there are integers encoded as strings (because, sigh) and it would be nice to be able to parse them dynamically for things like sorting.
Describe the solution you'd like
If we have data1.yml like:
(please keep to around 10 lines )
And we run a command:
yq 'sort_by(.version | parseint)'
it could output
Describe alternatives you've considered
I tried adding a
0
to try to force integer evaluation to no avail.Additional context
Generally being able to change the data type of a field while processing would be useful. Is this already available in some way I haven't found?
The text was updated successfully, but these errors were encountered: