在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
创建Lua函数载入CSV文件并保存到表中的函数: function GetLines(fileName) indx = 0 myLines ={} for line in io.line(string.format("%s%s", "c:/lua_scripts/",filename)) do indx = indx + 1 myLines[indx] = line end return indx, myLines --returns number of lines and line table end function GetValues(myString) num = 0 values = {} if myString ~= nil then while string.find(myString, ",") ~= nil do i, j =string.find(myString, ","); num =num + 1; values[num] = string.sub(myString, 1, j-1); myString = string.sub(myString, j+1, string.len(myString)) end num = num + 1 values[num] = myString end return num, values end
|
请发表评论