Solved

How can notepad recognize newline characters entered through code

Posted on 2010-11-09
3
1,124 Views
Last Modified: 2012-05-10
When I create a text file through code using file handling functions, notepad doesn't seem to recognize the newline character. But, when I open the text file using a more advanced text editor (Notepad++ / Word), the newline characters are displayed.

Is there a way where we could make sure that Notepad displays newlines correctly?
Thanks!
0
Comment
Question by:dshrenik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
brb6708 earned 500 total points
ID: 34094460
your code has to end a line with CR NL instead of NL only. Then notepad can use it correctly.
0
 

Author Comment

by:dshrenik
ID: 34096481
So this is the string that I must write: "\r\n"?
0
 
LVL 6

Assisted Solution

by:brb6708
brb6708 earned 500 total points
ID: 34096617
that's right.......

\r is decimal 13 or hexadecimal x\0d or octal \015
\n is decimal 10 or hexadecimal x\0a or octal \012
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question