Take the 2-minute tour ×


I don't believe this is an duplicate.....If you read the first 5 words("I'm using the Aspose library"). You will see he is using some 3rd party library. I am not. I am rendering a csv file that I want to open in excel.

I a C# application that generates a csv file. When I open up the csv file I notice that in columnA my text is in a single line. I would like to break it up into multiple lines(still in the same column).

I know if I use alt + enter in excel that will make new lines.

I know if I press enter in notepad++ it makes a label of (CR LF).

What code can I use to make it so I can have new lines that I can inject into my strings when in my C# application?

I tried


Nothing works.

share|improve this question
For clarification: in NP++ you can customize what it uses for newlines. CRLF is a likely default. –  TheZ Aug 10 '12 at 18:35
I am probably using the default as I did not know it could be changed. –  chobo2 Aug 10 '12 at 18:36
In the end it seems like Excel respects whatever notepad++ is using but when I try to inject it through c# code to make new lines it treats it as string value. –  chobo2 Aug 10 '12 at 18:37
LineFeed (Ascii char 10) should do it. Try saving an example csv from excel and confirm that's what it uses... –  Tim Williams Aug 10 '12 at 19:08
Notepad marks it as LF. So how do I use Ascii char 10 in a string and still have it recognize it as a code? –  chobo2 Aug 10 '12 at 19:10
show 1 more comment


Your Answer



Browse other questions tagged or ask your own question.