[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How can notepad recognize newline characters entered through code

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Introduction to Processes
Suggested Courses

649 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