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

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

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

Apache 2.4 + mod_wsgi + Python 3.7 + Django installation on Centos 7.10