geo-mapgen/csv.lua
Gael-de-Sailly 4d6adc295f Added CSV reader for Lua
to deal with biomes.csv and decorations.csv
(not implemented yet)
2018-02-20 18:14:38 +01:00

13 lines
246 B
Lua

local function read_csv(path)
local file = io.open(path, "r")
local t = {}
for line in file:lines() do
if line:sub(1,1) ~= "#" and line:find("[^%,% ]") then
table.insert(t, line:split(",", true))
end
end
return t
end
return read_csv