RosettaCodeData/Task/Nested-templated-data/Jq/nested-templated-data-3.jq

8 lines
284 B
Plaintext

payload | jq -Rrn --argfile t <(template) '
([inputs] | with_entries(.key |= tostring)) as $dict
| $t
| walk(if type == "number" then $dict[tostring] else . end),
"\nUnused payload",
$dict[(($dict|keys_unsorted) - ([ $t | .. | numbers ] | unique | map(tostring) ))[]]
'