RosettaCodeData/Task/Nested-templated-data/Jq/nested-templated-data-3.jq
2023-07-01 13:44:08 -04:00

7 lines
284 B
Text

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) ))[]]
'