Add headers to rowS (SSSSSSSSSSSSSSSS) and not individual row

This commit is contained in:
2025-11-15 16:56:46 +01:00
parent e02c1f018f
commit c145ad0900
2 changed files with 6 additions and 6 deletions

View File

@@ -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