Remove string from file in Windows 10 powershell like sed

Remove string from file in Windows 10 powershell like sed

 
If you need to edit file like stream and replace/remove string in
Windows using powershell

this command will open text.txt file, search for ",,,,," and replace
with nothing "" and save as new file test2.txt

get-content test.txt | %{$_ -replace ",,,,,",""} | set-content test2.txt

Comments

Popular posts from this blog

Securing the Pi-hole with fail2ban to prevent DNS Amplification attacks

How to clean DB from old logs in Magento 1.x

Python pxssh failed on login. could not set shell prompt