Closed agladysh closed 1 year ago
Hey! It looks like your example is not really a valid CSV, so ftcsv is not going to be able to parse it. You could always strip out the first row if needed, and then parse without headers. I suppose the error message could be improved to indicate that an empty value was found for a header in the first row.
The headers=false
is for parsing header-less files, but the first row will still get parsed and put into the parsed data structure. So instead of data[1].a = 1
, where a
is the name of the header, it'll parse using numbers so data[1][1] = 'a'
and data[2][1] = 1
Hope this helps!
Actually, I take that back. This is an interesting bug. With that specific setup, data[1][3]
should come in empty. I'll see about getting this fixed.