3

if I do with powershell that

    [string]$text = "this `nis a `ntest"
    $text > c:\test.txt

with notepad++ this is the result:

    this
    is a
    test

but if I open it with notepad of windows it doesn't work:

    this is a test

why that? how can I fix it?

rschirin
  • 1,939
  • 10
  • 34
  • 44

1 Answers1

8

Notepad exclusively uses Windows CRLF EOL markers. To get your line breaks to show in Notepad, use this:

`r`n

Reasonable text editors (read: almost everything but notepad.exe - I'm partial to Notepad++) handle all EOL styles properly - CRLF, CR, and LF.

alroc
  • 27,574
  • 6
  • 51
  • 97