Closed sanpii closed 10 months ago
It is a well-known fact that, in the jq family of languages (jq, gojq, jaq, ...), the abbreviated form .key cannot be used for keys with non-alphanumeric characters other than the underscore. One possibility is simply to use double-quotation marks:
$ echo '{"key with space": 10}' | jaq '."key with space"'
Here, the single-quotes are only needed to pass the text of the jaq program to the jaq interpreter.
@pkoppstein did you mean jaq '."key with space"'
?
@sanpii if this looks confusing maybe it clarifies things to think about it as .abc
and ."abc"
being shorthands for .["abc"]
Thank you for these clarifications.
Keys are string and can contain spaces.
Expected: