Parsing Key Value pairs from inconsistent and incomplete data

excel_lente

New Member
Joined
May 20, 2019
Messages
1
Hey all,

I have a CSV file with the following data in rows:

{'gender': 'male', 'age': '35', 'hometown': 'Chicago', 'car': 'Civic', 'occupation': 'actor', 'salary': '80000'}
{'gender': 'male', 'age': '32', 'hometown': 'New York', 'occupation': 'banker', 'salary': '130000'}
{'gender': 'female', 'age': '33', 'hometown': 'Seattle', 'occupation': 'developer'}
{'age': '27', 'hometown': 'Detroit', 'car': 'Mustang', 'salary': '75000'}

As you can see, there are recurring attributes (i.e. Gender, Age, Hometown, Car, Occupation, Salary), but this data is complete for every record, making it difficult / impossible to simply separate via Column-To-Test techniques.

Is there a way to use Excel to parse this data into columns and rows?

I'd like to use the attributes as column headers, so that when a "value" is missing, it would simply be a blank cell:

genderagehometowncaroccupationsalary
Male35ChicagoCivicActor80000
Male32New YorkBanker130000
Female33SeattleDeveloper

<tbody>
</tbody>

Thanks in advance!

<tbody>
</tbody>

excel_lente

Also posted
https://www.excelforum.com/excel-ge...rs-from-inconsistent-and-incomplete-data.html
 
Last edited by a moderator:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,215,379
Messages
6,124,610
Members
449,174
Latest member
ExcelfromGermany

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top