Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Most documents I'm opening in notepad.exe under windows 7 lately, there are no linebreaks... everything just runs together. The same documents in any other program, even previewed directly in Explorer, will show the linebreaks correctly. this is happening with many .info files, .css, .js.. but not all of them.

I am guessing it's some kind of character encoding unix line endings something or other, but wondering if there's anything I can do or if anyone else has experienced similar and if I can make notepad work correctly. I prefer it to notepad++/other text editors for certain uses.

share|improve this question
add comment

3 Answers

up vote 9 down vote accepted

There are line-breaks, however different operating systems recognise different sequences for line-breaks.

Notepad only recognises CR, LF (0x0d, 0x0a), whereas other sources might use CR only, or LF only.

You can't make Notepad behave differently, so your only option is to make sure the content has the right sequence for Notepad. Note that notepad is the only editor with this restriction, so if your content works in Notepad, it will work everywhere else.

One simple way to fix the line-feeds is to copy and paste the text into Word, then back again into notepad, and the line-feeds will get "corrected" to the CR,LF sequence.

share|improve this answer
2  
aha! sounds a bit like ditching notepad might be far easier ;P –  Damon Nov 28 '11 at 4:02
    
Absolutely (padding). –  Paul Nov 28 '11 at 4:04
    
I copied/pasted a text from NP++ to Notepad (Win). Because it wasn't properly encoded, Notepad ignores my line-breaks. I set the encoding in NP++ to "UTF-8" and everything works fine. Thanks :) –  Arkana Jul 10 '13 at 10:39
add comment

You need to change the type of line-break encoding used in the file.

In Linux there is a program called "unix2dos" that can do that for you. I am unsure if Windows comes with such a program, but there appears to be a similar one available here: http://www.thefreecountry.com/tofrodos/

There is more information regarding this process in Wikipedia: http://en.wikipedia.org/wiki/Unix2dos where you can get examples of different command line programs that can do the change.

share|improve this answer
    
if you have Sublime installed, you can choose View->Line endings -> Windows and then save the file to overwrite it. In this case unix line endings will turn into Windows format. If you open this saved file in Notepad, it will show line endings correctly. –  Junior Mayhé Apr 30 at 17:12
add comment

Wordpad

If your aversion to notepad++ and other text editors is that they are not a standard part of all Windows systems, use Wordpad. It's not quite as rudimentary as Notepad.

Wordpad will correctly read and display text files with with Unix line-endings.

Other

If you are averse to both the one-true text editors then notepad++ is probably a good choice.

share|improve this answer
    
my prob w/ notepad++ for really quick viewing/editing is actually that it keeps multiple documents open unless I specifically close them; just doesn't feel right for that use. I may just reassociate text type files with worpad and make sure it's in my open with... menu. –  Damon Nov 29 '11 at 16:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.