One possibility would be to use walk/1, but your jq might not have it. If you want to use walk/1, you could find its definition in jq by googling for: jq def walk. Here’s how it could be used: walk(if type==object then with_entries(.key|=ascii_downcase) else . end), ascii_downcase, ascii_upcase. Emit a copy of the input string with its alphabetic characters (a-z and A-Z) converted to the specified case. while(cond update) The while(cond update) function allows you to repeatedly apply an update to . until cond is false. Note that while(cond update) is internally defined as a recursive jq function.
ascii_downcase, ascii_upcase. Emit a copy of the input string with its alphabetic characters (a-z and A-Z) converted to the specified case. while(cond update) The while(cond update) function allows you to repeatedly apply an update to . until cond is false. Note that while(cond update) is internally defined as a recursive jq function.
5/6/2021 · jq -c ‘ {type: .type, features: [.features[] | {type: .type, properties: .properties | del(.REMOVE_SOME_KEY) | with_entries(.key |= ascii_downcase) | ( . += {ADD_KEY: .ANOTHER_PROPERTIES_KEY}) | del(.ANOTHER_PROPERTIES_KEY), geometry: .geometry}]} ‘ $PATH_TO_FILE > $PATH_TO_NEW_FILE, 7/18/2014 · I found ascii_ downcase from builtin. jq to do just this Yes, but as the name suggests, it works only for ASCII characters. For instance, UTF-8 characters of accented letters (e.g. Á or Ñ ) in a string, will be simply ignored and returned in uppercase.
jq: Command-line JSON processor – Linux Man Pages (1), json – Select objects based on value of variable in object …
JavaScript String toLowerCase() Method – W3Schools, jq Cheet Sheet · GitHub, For instance, running the command jq ‘map(.price) | add’ will take an array of JSON objects as input and return the sum of their price fields. jq can accept text input as well, but by default, jq reads a stream of JSON entities (including numbers and other literals) from stdin. Whitespace is only needed to separate entities such as 1 and 2, and true and false.
Definition and Usage. The toLowerCase() method converts a string to lowercase letters. Note: The toLowerCase() method does not change the original string. Tip: Use the toUpperCase() method to convert a string to uppercase letters.
11/27/2020 · * The extension functions downcase and upcase are not present in standard JQ. They differ from ascii_downcase and ascii_upcase in that they change casing for all Unicode letters, not only for ASCII letters (A-Z). ** Only g, i, m, n regular expression flags are supported.
10/3/2014 · It seems to me the best and simplest thing to do here is to provide upcase and downcase in the same manner as ruby, e.g. quoting from the ruby 2.1 documentation: upcase – Returns a copy of str with all lowercase letters replaced with their uppercase counterparts. The operation is locale insensitiveonly characters a to z are affected.
11/23/2020 · A jq behavior fix (even if it may possibly affect users) will not be considered a major change if the fix is to make the bahavior compatible with ./ jq these kind of incompatible changes are documented in the release note. If you get different results between ./ jq and jackson- jq , please file an issue. That is a bug on jackson- jq side.