Skip to content

Commit c9988c8

Browse files
committed
handle blank lines more correctly
1 parent ac033b3 commit c9988c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/csv.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ local function separated_values_iterator(file, parameters)
285285
elseif parameters.header and not header then
286286
header = fields
287287
else
288-
if fields[1] ~= "" or fields[2] then -- ignore blank lines
288+
local k, v = next(fields)
289+
if v ~= "" or field_count > 1 then -- ignore blank lines
289290
coroutine.yield(fields, starts)
290291
end
291292
end

0 commit comments

Comments
 (0)