pip install xlrd
在excel表中的tablelist表中fields列中,增加了别名的支持 如language.xlsx中
filename describe outfilename fields
language 测试 language_cn.json id,cn:txt
language 测试 language_en.json id,en:txt
language 测试 language_yn.json id,yn:txt
生成json后,输出的字段名都变成txt了。
def FloatToString (aFloat):
if type(aFloat) != float:
return ""
strTemp = str(aFloat)
strList = strTemp.split(".")
if len(strList) == 1 :
return strTemp
else:
if strList[1] == "0" :
return strList[0]
else:
return strTemp
Field1,Field2,Field3,Field4
test1,1,["hello","hello1"],[1,2]
test2,2,["ssss","abc"],[3,4]
{
"list":[
{ "Field1":"test1", "Field2":1, "Field3":["hello","hello1"], "Field4":[1,2] },
{ "Field1":"test2", "Field2":2, "Field3":["ssss","abc"], "Field4":[3,4] }
]
}
[mytest1]
Field1 = test1
Field2 = 1
Field3 = ["hello","hello1"]
Field4 = [1,2]
[mytest2]
Field1 = test2
Field2 = 2
Field3 = ["ssss","abc"]
Field4 = [3,4]
[mytest]
Count = 2
truncate table mytest;
set names 'utf8';
set autocommit=0;
insert into mytest set Field1 = 'test1', Field2 = 1, Field3 = ["hello","hello1"], Field4 = [1,2];
insert into mytest set Field1 = 'test2', Field2 = 2, Field3 = ["ssss","abc"], Field4 = [3,4];
commit;
[CMyTest]
<Field4,Field3,Field2,Field1>
#[1,2],["hello","hello1"],1,"test1"
#[3,4],["ssss","abc"],2,"test2"
package com.hxgd.cfg
{
public class CMyTest extends ConfigBase
{
public function CMyTest()
{
super();
}
override public function DoLoad(paramRecord:Array):void
{
Field4 = paramRecord[0];
Field3 = paramRecord[1];
Field2 = paramRecord[2];
Field1 = paramRecord[3];
}
public var Field4:Array=[];
public var Field3:Array=[];
public var Field2:Number;
public var Field1:String;
}
}