I have a JSON file in non-standard format, like this:
{
"color": "black",
"category": "hue",
"type": "primary"
}
{
"color": "white",
"category": "value",
"type": "idk"
}
{
"color": "red",
"category": "hue",
"type": "primary"
}
Except it has over 10,000 entries formatted this way. I have to access the color and type for each separate part and create a string for each that says "type color" like "primary black".
I wanted to edit the file using Python to look like this:
[
{
"color": "black",
"category": "hue",
"type": "primary"
},
{
"color": "white",
"category": "value",
"type": "idk"
},
{
"color": "red",
"category": "hue",
"type": "primary"
},
]
So I can access the values with [] and use a for-loop for all of them. How would I do this? Is there a better way to accomplish this than editing the json file?