CSwiftV icon indicating copy to clipboard operation
CSwiftV copied to clipboard

CSV without headers

Open mariovillamizar opened this issue 7 years ago • 1 comments

I'm downloading a cvs file without headers. I'm getting the next cvs string:

0.183764, -0.309156, 0.492920
0.183765, -0.309157, 0.492921
0.183766, -0.309158, 0.492922

Actually this library is taking as header the elements of the first row, and the rows are the elements of second a third rows from the downloaded string. I have fixed this bug with this code:

let csv = CSwiftV(string: csvString, separator: ",", headers: [String](count: 3, repeatedValue: "")) However, is there any way to disable the headers when these doesn't exist?... If not, can you add this to the library please?.. Maybe something like this:

let csv = CSwiftV(string: csvString, headersExist: false)

mariovillamizar avatar Jul 21 '16 19:07 mariovillamizar

Hi, Sorry for such a late response. This is a really good issue. I don't have too much time at the moment, but I'll keep the issue open and it will be the next new feature to add.

Daniel1of1 avatar Aug 06 '16 21:08 Daniel1of1