From c9988c8b93f98bb9adc10661f6270beebe0d88af Mon Sep 17 00:00:00 2001 From: Geoff Leyland Date: Wed, 29 Jan 2014 13:28:47 +1300 Subject: [PATCH] handle blank lines more correctly --- lua/csv.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/csv.lua b/lua/csv.lua index 79a5d16..36b57cf 100644 --- a/lua/csv.lua +++ b/lua/csv.lua @@ -285,7 +285,8 @@ local function separated_values_iterator(file, parameters) elseif parameters.header and not header then header = fields else - if fields[1] ~= "" or fields[2] then -- ignore blank lines + local k, v = next(fields) + if v ~= "" or field_count > 1 then -- ignore blank lines coroutine.yield(fields, starts) end end