3dPrinting :
- riorganizzazione - correzioni nel collegamento e nel riordino dei setti.
This commit is contained in:
@@ -12,6 +12,7 @@ EgtOutLog( ' CSVManager started', 1)
|
||||
-- Dati
|
||||
local AMD = require( 'AddManData')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function toCSV (t)
|
||||
local s = ""
|
||||
for _,p in pairs(t) do
|
||||
@@ -19,7 +20,8 @@ function toCSV (t)
|
||||
end
|
||||
return string.sub(s, 2) -- remove first comma
|
||||
end
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function escapeCSV (s)
|
||||
if string.find(s, '[,"]') then
|
||||
ns = '"' .. string.gsub(s, '"', '""') .. '"'
|
||||
@@ -27,6 +29,7 @@ function escapeCSV (s)
|
||||
return s
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function fromCSV(s)
|
||||
s = s .. ';' -- ending comma
|
||||
local t = {} -- table to collect fields
|
||||
@@ -53,6 +56,7 @@ local function fromCSV(s)
|
||||
return t
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function read_file( path)
|
||||
local file = io.open( path, "r") -- r read mode and b binary mode
|
||||
if not file then return nil end
|
||||
@@ -67,4 +71,5 @@ function read_file( path)
|
||||
return CSVTable
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return CSVManager
|
||||
|
||||
Reference in New Issue
Block a user