mirror of
https://github.com/ShadMOrdre/lib_materials.git
synced 2024-11-14 14:40:29 +01:00
13 lines
277 B
Lua
13 lines
277 B
Lua
|
local function read_csv(separator, path)
|
||
|
local file = io.open(path, "r")
|
||
|
local t = {}
|
||
|
for line in file:lines() do
|
||
|
if line:sub(1,1) ~= "#" and line:find("[^%"..separator.."% ]") then
|
||
|
table.insert(t, line:split(separator, true))
|
||
|
end
|
||
|
end
|
||
|
return t
|
||
|
end
|
||
|
|
||
|
return read_csv
|