Add headers to rowS (SSSSSSSSSSSSSSSS) and not individual row
This commit is contained in:
@@ -220,9 +220,9 @@ function fromCSV(csv, options)
|
||||
row[headerName] = dataRow[j]
|
||||
end
|
||||
end
|
||||
row.Headers = headers
|
||||
table.insert(rows, row)
|
||||
end
|
||||
rows.Headers = headers
|
||||
return rows, nil
|
||||
end
|
||||
|
||||
@@ -255,9 +255,9 @@ function toCSV(rows, options)
|
||||
local rowStrings = {}
|
||||
|
||||
-- Include headers row if requested and available
|
||||
if includeHeaders and #rows > 0 and rows[1].Headers ~= nil then
|
||||
if includeHeaders and #rows > 0 and rows.Headers ~= nil then
|
||||
local headerStrings = {}
|
||||
for _, header in ipairs(rows[1].Headers) do
|
||||
for _, header in ipairs(rows.Headers) do
|
||||
local headerStr = tostring(header)
|
||||
local needsQuoting = false
|
||||
if
|
||||
|
||||
Reference in New Issue
Block a user