Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top