JSON文件和CSV文件互转工具

工作需要,写了这么一个 JSON和CSV互转的小工具。

界面

JSON2CSV

源码

https://github.com/zrong/json2csv

JSON范例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}}

转换成的CSV

1
2
3
4
5
6
7
8
9
10
11
widget,text,onMouseUp,sun1.opacity = (sun1.opacity / 100) * 90;
widget,text,style,bold
widget,text,alignment,center
widget,text,name,text1
widget,text,data,Click Here
widget,image,name,sun1
widget,image,src,Images/Sun.png
widget,image,alignment,center
widget,debug,on,
widget,window,name,main_window
widget,window,title,Sample Konfabulator Widget

留言

2013-01-06
次访问