?
Solved

How can notepad recognize newline characters entered through code

Posted on 2010-11-09
3
Medium Priority
?
1,131 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 2000 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 2000 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

Independent Software Vendors: 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

This is about my first experience with programming Arduino.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Introduction to Processes
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

764 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