Hi everyone, I am reading a CSV file, and I ran into a problem when there is a comma in the field
Everything works until I get a comma in a comma, all the fields will be "around".
string delimiter=","; using (var sr = new StreamReader(fileName)) { sr.ReadLine(); //skip headers while (!sr.EndOfStream) { var readline = sr.ReadLine(); if (readline == null) continue; var fields = readline.Split (delimiter.ToCharArray()); } }if I CANNOT split because of commas within quotation . How can I recode it?
I cannot use open source libraries or third parties.
Any suggestions?
source share