Solved

How can notepad recognize newline characters entered through code

Posted on 2010-11-09
3
1,127 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

Technology Partners: 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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Progress

729 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