arn:aws:iam::11111111111:role/ADFS-MyRoleName "Alexa for Business" "AWS Certificate Manager" "AWS Certificate Manager Private Certificate Authority" "AWS Amplify" "Manage - Amazon API Gateway" "AWS App Mesh" "Amazon AppStream 2.0" "AWS AppSync" "Amazon Athena" "AWS Auto Scaling" arn:aws:iam::12345678901:role/Role2-Role2 "Alexa for Business" "AWS Certificate Manager" "AWS Certificate Manager Private Certificate Authority" "AWS Amplify" "Manage - Amazon API Gateway" "Application Auto Scaling" "AWS App Mesh" "Amazon AppStream 2.0" "AWS AppSync"
I would like to create a hashmap so I can count the # of items under each of the 'arn' so the key would be arn:aws:iam::11111111111:role/ADFS-MyRoleName and the values would be everything until the 'blank line' which is the end of record marker. I had thought of using split, but am unsure on how to get the 1:many relationship going. I suspect I need to somehow use a for loop and iterate through each 'arn' value, see what happens between them, and then create a map from that. The only problem is I have no idea how to do this. I looked at data:dumper but this always assumes 1:1 relationships afaik. I couldn't grok it. Could anyone suggest a code snippet that will at least create the datastructure? I can do the rest, but I really am not good at datastructures.
In reply to How to Map a scalar to a key that is an array? by symgryph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |