1
votes

I want to read a CSV file using TextFieldParser with with the filed in double quotes and seperated with commas as the struture. How to get field values without double quotes after reading.

CSV struture is

"val1","val2","val3" "val4","val5","val6"

converted to val1,val2,val3 val4,val5,val6

1
After reading you can have the string replace of \" with string.empty - kishore V M

1 Answers

2
votes

Just replace all " with empty string.

 string yourCSVString; // "\"var1\",\"var2\",\"var3\"";
 string processedString;
 processedString=yourCSVString.Replace("\"","");
 Console.WriteLine(processedString);

Hope it helps.