Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don’t want to roll my own parser.

Also, I’ve seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a lot of people discourage this due to its “drawbacks.” What are these drawbacks?

Ideally, I’m looking for a way through which I can read the CSV by column name, using the first record as the header / field names. Some of the answers given are correct but work to basically deserialize the file into classes.

17 Answers
17

Leave a Comment