这是我的 Json 回复:
{
"value": [
{
"type": "school",
"id": 12,
"name": "NNPS",
"city": "CA",
"geo_position": {
"latitude": 52.52437,
"longitude": 13.41053
}
},
{
"type": "College",
"id": 44,
"name": "PEC",
"city": "PE",
"geo_position": {
"latitude": 45.50298,
"longitude": 10.04366
}
}
]
}
这是我使用“json.JSONArray”库的 java 代码:
while ((csvdata= br.readLine()) != null) {
JSONObject output= new JSONObject(csvdata);
JSONArray docs = output.getJSONArray("value");
String csv = CDL.toString(docs);
FileUtils.writeStringToFile(file, csv);
}
当我检查csv
文件时,它向我显示如下:
但它应该是这样的:
我正处于编码阶段的初期,目前正在改进它。请给我一些建议:)我应该如何改变它?