Does jq support case insensitive sorting?
for instance I have data.json like this
[
{"title": "first", "description": "foo"},
{"title": "Second", "description": "bar"}
]
simple jq 'sort_by(.title)' data.json returns
[
{"title": "Second", "description": "bar"},
{"title": "first", "description": "foo"}
]
actually jq has built-in filters ascii_downcase and ascii_upcase you can use like this jq 'sort_by(.title | ascii_downcase)' data.json to get proper result.
[
{"title": "first", "description": "foo"},
{"title": "Second", "description": "bar"}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With