Possible Duplicate:
Dealing with commas in a CSV file
We are exporting a bulk data into a csv file for one of our projects. So in this case we have to export values like a,b,c,d which all have to be remain in one column. But the comma will separate them to different columns.
Like if we export some values entered in textarea or editor which contains character like \r\n will be exported as separate rows in csv. How can i solve this problem??
if (data.Contains("\"")) { data = String.Format("\"{0}\"", data.Replace("\"", "\"\"")); }
as an escaped quote must be in a string that is itself within quotes. – Dayfly