Delmiter was not taken into account for Headers

Headers were always separated with "," char even when other delimiter was given.
This commit is contained in:
Robert M. Münch 2016-10-20 20:20:12 +02:00 committed by GitHub
parent ee24dcd9a6
commit 2e0d8a6284

View File

@ -442,7 +442,7 @@ function ftcsv.encode(inputTable, delimiter, options)
newHeaders[i] = headers[i] newHeaders[i] = headers[i]
end end
end end
output[1] = '"' .. table.concat(newHeaders, '","') .. '"\r\n' output[1] = '"' .. table.concat(newHeaders, '"' .. delimiter .. '"') .. '"\r\n'
-- add each line by line. -- add each line by line.
for i, line in writer(inputTable, delimiter, headers) do for i, line in writer(inputTable, delimiter, headers) do