swiftcsv / SwiftCSV

CSV parser for Swift
MIT License
947 stars 190 forks source link

CSV file without header row #121

Open patricks opened 1 year ago

patricks commented 1 year ago

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.

DivineDominion commented 1 year ago

Could you get past with the CSV 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?

MattTimmons commented 1 year ago

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.