Oct-30-2019, 12:32 PM
I don't fully understand objective but assuming that you have csv file named 'source-json.csv' with data on rows and want to have json one can simply do something along those lines:
import json with open('source-json.csv', 'r') as f: d = {k: v.strip() for (k, v) in enumerate(f, start=1)} j = json.dumps(d)One can write j to file or whatever:
Output:{"1": "1231241231", "2": "1235135135", "3": "5457345345", "4": "4577865568", "5": "8654563848"}
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.