How to write a value which contain comma to a CSV file in c#?
Simply put your data inside the backslash like this: “\”” + yourdata + “\””. Take a look on the example below: StringWriter csv = new StringWriter(); // Generate header of the CSV file csv.WriteLine(string.Format(“{0},{1}”, “Header 1”, “Header 2”)); // Generate content of the CSV file foreach (var item in YourListData) { csv.WriteLine(string.Format(“{0},{1}”, item.Data1, “\”” + … Read more