SwiftCSV icon indicating copy to clipboard operation
SwiftCSV copied to clipboard

CSV file without header row

Open patricks opened this issue 3 years ago • 2 comments

Hi,

I get CSV files without any header row. Is it possible to load this file and set the header manually via a header: [String] parameter? Currently the first row is always used as header. A workaround would be, that i load the file by myself and append the header to the string. But it would be much more convenient, if I could just load the CSV file via the URL.

patricks avatar Jan 26 '23 11:01 patricks

Could you get past with the CSV<Enumerated> approach for your needs for now?

Ideas for a PR:

Offering a way to read Enumerated and convert to Named sounds sensible.

Or offer a new initializer to Named that takes an array of column titles (and fails when there are to few).

WDYT?

DivineDominion avatar Jan 27 '23 12:01 DivineDominion

I am also needed a way to do this.. a csv without a header. But, please also my issue #124 where I can't even enumerate.

MattTimmons avatar Apr 05 '23 16:04 MattTimmons