0

I am new to Python and trying to edit a .json file that looks like the dictionary below: { "name": "MB_NDE_AX667_ECU[500-2000]", "physical_quantity": "acceleration", "unit": "m/s2", "okrangelow": 0, "okrangehigh": 10, "input": "ch2_ECU1.rms", "history": { "ds": 30, "timer": 24, "files": 30 }, "reg": 44 },

My goal is to get another json file that will have the dictionary restructured to single line dictionary, e.g:

{"name":"MB_NDE_AX667_ECU[500-2000]","physical_quantity":"acceleration",......}

How could I do this?

Thanks

I.Dragiev
  • 7
  • 4
  • By "single line" do you mean a single level of keys? – EliadL Jan 29 '19 at 09:40
  • Possible duplicate of [Python flatten multilevel JSON](https://stackoverflow.com/questions/51359783/python-flatten-multilevel-json) – EliadL Jan 29 '19 at 09:42
  • No I mean a single row of key:value pairs per dictionary - let's say 5 or 6 pairs,then the next dictionary(with 5 or 6 pairs) is on the next line and so on.. – I.Dragiev Jan 30 '19 at 05:20
  • And the current situation is that each dictionary takes up more than one line? If so, please update your question to reflect that with a good example. – EliadL Jan 30 '19 at 10:40

0 Answers0