문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top