Parsing CSV File enclosed with quotes in C#

后端 未结 10 2073
一整个雨季
一整个雨季 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:23

    I don't see how you could if each line is different. This line is a malformed for CSV. Quotes contained within a value must be doubled as shown below. I can't even tell for sure where the values should be terminated.

    "1",1/2/2010,"The sample (""adasdad"") asdada","I was pooping in the door ""Stinky"", so I'll be damn","AK"
    

    Here's my code to parse a CSV file but I don't see how any code would know how to handle your line because it's malformed.

提交回复
热议问题