I thought this will be trivial but I can\'t get this to work.
Assume a line in a CSV file:
\"Barack Obama\", 48, \"President\", \"1600 Penn Ave, Washington DC
You can't parse a CSV line with a simple Split on commas, because some cell contents will contain commas that aren't meant to delineate data but are actually part of the cell contents themselves.
Here is a link to a simple regex-based C# method that will convert your CSV into a handly DataTable
:
http://www.hotblue.com/article0000.aspx?a=0006
Working with DataTables is very easy - let me know if you need a code sample for that.