Parsing CSV File enclosed with quotes in C#

后端 未结 10 1972
一整个雨季
一整个雨季 2021-01-21 05:50

I\'ve seen lots of samples in parsing CSV File. but this one is kind of annoying file...

so how do you parse this kind of CSV

\"1\",1/2/2010,\"The sample (\"adas

10条回答
  •  攒了一身酷
    2021-01-21 06:28

    You might want to give CsvReader a try. It will handle quoted string fine, so you just will have to remove leading and trailing quotes.

    It will fail if your strings contains a coma. To avoid this, the quotes needs to be doubled as said in other answers.

提交回复
热议问题