skip to Main Content

Convert a single JSON to multiple jsons by taking one of the key values? – Amazon Web Sevices

I currently have one json file as follows in terms of formatting: { "Comment":"json data", "Changes":[ { "Action":"DELETE", "ResourceRecordSet":{ "Name":"record1", "Type":"CNAME", "SetIdentifier":"record1-ap-northeast", "GeoLocation":{ "CountryCode":"JP" }, "TTL":60, "ResourceRecords":[ { "Value":"record1" } ], "HealthCheckId":"ID" } }, { "Action":"DELETE", "ResourceRecordSet":{ "Name":"record2", "Type":"CNAME", "SetIdentifier":"record2-ap-south",…

VIEW QUESTION

Json – Can this jq map be simplified?

Given this JSON: { "key": "/books/OL1000072M", "source_records": [ "ia:daywithtroubadou00pern", "bwb:9780822519157", "marc:marc_loc_2016/BooksAll.2016.part25.utf8:103836014:1267" ] } Can the following jq code be simplified? jq -r '.key as $olid | .source_records | map([$olid, .])[] | @tsv' The use of variable assignment feels like cheating…

VIEW QUESTION
Back To Top
Search