dashbitco / nimble_csv

A simple and fast CSV parsing and dumping library for Elixir
https://hexdocs.pm/nimble_csv
772 stars 51 forks source link

Can't Get Headers #26

Closed xanderdunn closed 7 years ago

xanderdunn commented 7 years ago

I run CSV.parse_string(some_string, header: false) and get the same output as when I run CSV.parse_string(some_string, header: true).

some_string looks like:

"id,probability\nn00e1d5ebcf3d4d5,0.51228\nnb0b4cce48b78471,0.51814\nn...

so I'd expect to get ["id", "probability"] in the header: false case, but I don't get it. I always get the same result:

[["n00e1d5ebcf3d4d5", "0.51228"], ["nb0b4cce48b78471", "0.51814"], ... ]

I have nimble_csv 0.3.0. Am I misusing the header option?

josevalim commented 7 years ago

It should be :headers (plural).

xanderdunn commented 7 years ago

Thanks, that worked. I guess it was changed to header in 0.4.0?