-
Notifications
You must be signed in to change notification settings - Fork 0
API 文档 Csv
xerysherry edited this page Nov 7, 2019
·
1 revision
path: 字符串, Csv路径
设置Csv路径
返回Csv路径
name: 字符串, Csv文件名, 无需.csv后缀名 haskey: 布尔型, 是否包含列头 dictflag: 布尔型, 是否解码字典格式
Csv解码, 优先读取Resources/Csv/下文件
--[[
Project Path/Csv/test.csv
content:
a, b, c
1, 2, 3
4, 5, 6
7, 8, 9
]]
SetCsvPath("Csv")
local t1 = CsvDecode("test")
-- t1 = {{"a", "b", "c"},{"1", "2", "3"},{"4", "5", "6"},{"7", "8", "9"}}
local t2 = CsvDecode("test", true)
-- t2 = {{a="1", b="2", c="3"},{a="4", b="5", c="6"},{a="7", b="8", c="9"}}
local t3 = CsvDecode("test", true, true)
--[[ t2 = {
["1"]={a="1", b="2", c="3"},
["4"]={a="4", b="5", c="6"},
["7"]={a="7", b="8", c="9"},
}]]