Trying to pick up only 62f0fac3-8b19-49de-866b-5f5cf23f2f9f and bd23d38d-8833-4fc4-b6c0-3906df0ed161 through bash shell pattern matching from below example file. The file has single line text with many such pattern occurrences.
Tried back reference of grep and sed. none seems to be working. Any help greatly appreciated.
"type": "Primary", "id": "418bf692-4f20-4597-b624-5a7242b82379", "expireIn": {"count": 0, "unit": "hours"}}], "copyModel": "ARCHIVE", "id": "6f2d6bc6-f67c-41b8-b11a-b5a59d7a6ac3"}], "id": "62f0fac3-8b19-49de-866b-5f5cf23f2f9f", "createdAt": "2020-08-11T17:33:45.754863Z", "name": "Susanta Copy Policy"}, "locked": false, "type": "Primary", "id": "ca85d285-8b73-42ec-aab1-c4d13572db94", "expireIn": {"count": 61, "unit": "days"}}], "advancedOptions": {"targetConnectivity": "Auto"}, "id": "f61e67a4-eea6-4922-9cc1-491a5429b199"}], "id": "bd23d38d-8833-4fc4-b6c0-3906df0ed161", "createdAt": "2020-07-14T19:01:33.202434Z", "name": "App Gold Policy"}, "locked": false
#
#
# cat test | grep -E '\"id\": \"(.*)\", \"createdAt\": \"'
"type": "Primary", "id": "418bf692-4f20-4597-b624-5a7242b82379", "expireIn": {"count": 0, "unit": "hours"}}], "copyModel": "ARCHIVE", "id": "6f2d6bc6-f67c-41b8-b11a-b5a59d7a6ac3"}], "id": "62f0fac3-8b19-49de-866b-5f5cf23f2f9f", "createdAt": "2020-08-11T17:33:45.754863Z", "name": "Susanta Copy Policy"}, "locked": false, "type": "Primary", "id": "ca85d285-8b73-42ec-aab1-c4d13572db94", "expireIn": {"count": 61, "unit": "days"}}], "advancedOptions": {"targetConnectivity": "Auto"}, "id": "f61e67a4-eea6-4922-9cc1-491a5429b199"}], "id": "bd23d38d-8833-4fc4-b6c0-3906df0ed161", "createdAt": "2020-07-14T19:01:33.202434Z", "name": "App Gold Policy"}, "locked": false
#
# cat test | grep -E '\"id\": \"(.*)\", \"createdAt\": \"\1'
#
# cat test | sed -E 's/\"id\"(.*)\"\, \"createdAt\": \"/\1/'
"type": "Primary", : "418bf692-4f20-4597-b624-5a7242b82379", "expireIn": {"count": 0, "unit": "hours"}}], "copyModel": "ARCHIVE", "id": "6f2d6bc6-f67c-41b8-b11a-b5a59d7a6ac3"}], "id": "62f0fac3-8b19-49de-866b-5f5cf23f2f9f", "createdAt": "2020-08-11T17:33:45.754863Z", "name": "Susanta Copy Policy"}, "locked": false, "type": "Primary", "id": "ca85d285-8b73-42ec-aab1-c4d13572db94", "expireIn": {"count": 61, "unit": "days"}}], "advancedOptions": {"targetConnectivity": "Auto"}, "id": "f61e67a4-eea6-4922-9cc1-491a5429b199"}], "id": "bd23d38d-8833-4fc4-b6c0-3906df0ed1612020-07-14T19:01:33.202434Z", "name": "App Gold Policy"}, "locked": false
#```