{"i": "56", "m1": "IT", "m2": "Area", "r": "faced this problem"}
{"i": "57", "m1": "IT", "m2": "Area", "r": "faced this problem3"}
这是JSON的格式吗?
答案 0 :(得分:0)
代码
import json
with open('input.json', "r") as in_file:
data = json.load(in_file)
with open('output.csv', 'w') as out_file:
for entry in data:
out_file.write(','.join(entry.values()) + '\n')
input.json
[
{
"i": "56",
"m1": "IT",
"m2": "Area",
"r": "faced this problem"
},
{
"i": "57",
"m1": "IT",
"m2": "Area",
"r": "faced this problem3"
}
]
output.csv
56,IT,Area,faced this problem
57,IT,Area,faced this problem3