I'm trying to use PowerShell to convert a json with the following format:
{"Value1":[89,91,88,71,59],"Value2":[53,58,54,53,58]}
To a CSV with the following format:
Value1,Value2
89,53
91,58
88,54
71,53
59,58
The issue I'm running into is that this code that I've cobbled together
Get-Content 'C:\test\test.json' | ConvertFrom-Json |
select @{n='value1';e={-split $_.value1}},
@{n='value2';e={-split $_.value2}} |
Export-Csv -NoTypeInformation 'C:\test\test.csv'
is making a CSV with the following format:
Value1,Value2
89 91 88 71 59,53 58 54 53 58
Does anybody have any ideas on what I could do here? I'm really new to PowerShell and I'm getting pretty lost. I've read a ton of similar items on here and other sites, but none that exactly fit the issue I'm running into.
Thanks