How to properly split a CSV using C# split() function?

前端 未结 6 880
旧时难觅i
旧时难觅i 2020-12-05 19:21

Suppose I have this CSV file :

NAME,ADDRESS,DATE
\"Eko S. Wibowo\", \"Tamanan, Banguntapan, Bantul, DIY\", \"6/27/1979\"

I would like like

6条回答
  •  醉话见心
    2020-12-05 19:58

    It's not an exact answer to your question, but why don't you use already written library to manipulate CSV file, good example would be LinqToCsv. CSV could be delimited with various punctuation signs. Moreover, there are gotchas, which are already addressed by library creators. Such as dealing with name row, dealing with different date formats and mapping rows to C# objects.

提交回复
热议问题