Tuesday, September 12, 2017

Powershell Remove spaces from the end of lines in a text file

Use this two lines and define your old and new file.

$file = Get-Content "C:\admin\OldFile.txt"
$file | Foreach {$_.TrimEnd()} | Set-Content "C:\admin\NewFile.txt"


No comments:

Post a Comment