Removing line break powershell

后端 未结 3 913
礼貌的吻别
礼貌的吻别 2020-12-17 22:47

I am having an issue with a line break in my data. The array was made with an out-string followed by -split. If you want to see that part of the script let me know.

3条回答
  •  情歌与酒
    2020-12-17 23:43

    By default, 'Get-Content' command has the default delimiter of a new line '\n'. Create a costume parameter and then do your replace command. Hope this helps.

    Get-ChildItem | Get-Content -Delimiter "~" | foreach { $_ -replace "`r|`n","" }
    

提交回复
热议问题