Solved

How can notepad recognize newline characters entered through code

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now