I am using StreamWriter to write records in csv
Data = "abcd+ " , " + "Error + " , " + result.Message;
using (StreamWriter streamWriter = new StreamWriter("c:/temp/data.csv"))
{
streamWriter.WriteLine(Data);
}
Result.Message - Failed to poll for ordered service from Encompass: {\r\n \"code\": \"VPC-999999\",\r\n \"summary\": \"Error occurred in Vendor Platform\",\r\n \"details\": \"Partner error occurred - E206 : Access to report denied\",\r\n \"product\": e
So it has special characters in it.
In csv file I need to have 3 columns with
1st coulmn - abcd
2nd column - Error
3rd column - Failed to poll for ordered service from Encompass: {\r\n \"code\": \"VPC-999999\",\r\n \"summary\": \"Error occurred in Vendor Platform\",\r\n \"details\": \"Partner error occurred - E206 : Access to report denied\",\r\n \"product\": e
Since this long text contains special chars, in csv it gets written to next line and so. How to treat this whole message as 1 text and can put it in 1 cell?