Parsing CSV files in C#, with header

后端 未结 17 1957
悲哀的现实
悲哀的现实 2020-11-21 06:57

Is there a default/official/recommended way to parse CSV files in C#? I don\'t want to roll my own parser.

Also, I\'ve seen instances of people using ODBC/OLE DB to

17条回答
  •  不要未来只要你来
    2020-11-21 07:08

    Based on unlimit's post on How to properly split a CSV using C# split() function? :

    string[] tokens = System.Text.RegularExpressions.Regex.Split(paramString, ",");
    

    NOTE: this doesn't handle escaped / nested commas, etc., and therefore is only suitable for certain simple CSV lists.

提交回复
热议问题