CSV ignoring between Quotes

I’m trying to parse a CSV file, that has some data within Quotes, that I want to keep as a chunk not split any commas within it. Do I have to go through it as chars and count quotes, or is there an easier way? for example

Item, “spread1, spread2”, NextItem

Would be

spread1, spread2

(Or read an Excell file)

there is an excel file reader by sebl: Excel to XDocument
and there are many CSV related nugets: https://www.nuget.org/packages?q=csv

I’ve had some success with EPPlus ( - the last free version)] – extending a patch generously provided by @sebl. I can have a look on monday at the office, if you are interested.

1 Like

It would be useful to excell support, so it would be great to see that, thanks!

Here you go:
VL.Excel.7z (131.4 KB)


Doesnt like my xls file :(

save as xlsx?
or post a sample file.

Tried that first! https://www.dropbox.com/s/7zr0d2wx5ljifud/DatabaseExportForChrisPlant.xlsx?dl=0
I changed the worksheet name in the patch, but still no go. Its not my final xls, or even the one I need to use, just one that was lying around, be nice to know why it might or might not work.

It works (with xlsx) when the sheetname doesn’t contain spaces.


Ah, anyway of working around that, as a generalised solution of excel docs, its not ideal. I can make it work for this project I guess, but I guess this a closed source library so there is no way to fix. Maybe I’ll try and find another one

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.