lua-csv icon indicating copy to clipboard operation
lua-csv copied to clipboard

It returns one extra result

Open x-yuri opened this issue 4 years ago • 0 comments

local csv = require 'csv'
local inspect = require 'inspect'

local f = csv.open('/tmp/a.csv', {
    separator = ';',
    header = true,
})
for fields in f:lines() do
    print(inspect(fields))
end

/tmp/a.csv:

a;b;c
1;2;3

Output:

{
  a = "1",
  b = "2",
  c = "3"
}
{
  a = ""
}

I'd expect only one iteration. The field is added here. How do I distinguish this extra result from the genuine ones?

x-yuri avatar May 09 '21 01:05 x-yuri