Create new columns from multiple values in one column

Powershell newbie…I am stuck on how to take one cell/field of data that hold multiple values and create new columns for each one. The other issue is for each of the multivalve cells/fields there are a different values and none have the exact same values so I need to do some type of wildcard script that will just grab each value and create a new column. The example is get-ec2instance. I can drill down to the tags and further down to the keys and values for all of the tags for a particular ec2 instance. I can grab all the data but “converting” each key to a new column with its associated value is eluding me. Appreciate any insight on how to accomplish this.


Welcome to the forum. :wave:t4:

It will be nearly impossible to answer something meaningful without seeing your code and some examples of your data. Not all of us have access to EC2 to be able to reproduce your situation.

Regardless of that your approach might not be the best way to deal with the data. If the data are hierarchical it does not make sense to put them into a CSV like structure. :wink: Maybe an output as JSOPN or XML fits better for your requirement.

When you crosspost the same question at the same time to different forums you should at least post links to the other forums along with your question to avoid people willing to help you making their work twice or more.