I am using an csv to json converter but it messes up my order of objects. I tried different converting-scripts, but they all mess up the order. My csv is ordered like this:
Group-of-Signals name,Group-of-Signals description,Signal name,Signal data type,Signal unit of measurement,Signal description,Signal ID,Signal index
But after the conversion it looks like this:
[{
"Signal ID": "-1",
"Group-of-Signals description": "",
"Signal index": "0",
"Signal name": "EUVPulseCount",
"Signal unit of measurement": "M",
"Signal data type": "SDT_STRING",
"Signal description": "",
"Group-of-Signals name": "DPI_0"
}]
I would like to have it like this:
[{
"Group-of-Signals name" : "DPI_0",
"Group-of-Signals description" : "",
"Signal name" : "EUVPulseCount",
"Signal data type" : "SDT_STRING",
"Signal unit of measurement" : "M",
"Signal description" : "",
"Signal ID" : "-1",
"Signal index" : "0"
}]
I have included the code over here so it won't be a messy question: https://codeshare.io/B0KyP
I checked the answer that is here: Items in JSON object are out of order using "json.dumps"? but I can't get it to work.
UPDATE: I still don't have it working. All the solutions are about loading a JSON file. In my case I don't load JSON file. I dump data in a new created JSON-file.