Reputation: 457
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
Upvotes: 1
Views: 1011
Reputation: 5070
Just replace all " with empty string.
string yourCSVString; // "\"var1\",\"var2\",\"var3\"";
string processedString;
processedString=yourCSVString.Replace("\"","");
Console.WriteLine(processedString);
Hope it helps.
Upvotes: 2