with open(output_file_path_final, 'w') as f:
json.dump(final, f, separators=(',', ':'))
this is the key lines of my python code and I get output as below,
{"frame.number":[80.0,87.0,93.0,95.0,99.0,....],"frame.timestamp [s]":[1324055659.394, 1324055659.488, 1324055659.607, 1324055659.613, 1324055659.695,.....], ......... "{31} EVSE Maximum Power Limit [W]":[null, null, null, null, null, null,....]}
separators=(',\n', ':')) : this solution didn't work because it gives every parameter in new line.
{"frame.number":[80.0, 87.0, 93.0, 95.0, 99.0, 103.0, 106.0,.......],
"frame.timestamp [s]":[1324055659.394, 1324055659.488, 1324055659.607, 1324055659.613, 1324055659.695,.....],
.
.
.
.
"{31} EVSE Maximum Power Limit [W]":[null, null, null, null, null, null,....]
}
If you check the docs for
json.dump, you can read:so consider
json.dump(final, f, indent=4)instead