I am building “export” functionality; I am using a StreamWriter to write some data in CSV format so that it can be opened in excel.
Problem is, it turns out that in that data, there is the string \r\n which seems to be causing the StreamWriter to treat this as newline, and this stuffs up the table in excel.
Is there a way to ignore the \r\n ? Any ideas ?
You could use the .Replace(“\r\n”, “”);
also to make the answer more exact could you paste the code where you are parsing and or creating the comma delimited file ..?