Wednesday, January 15, 2020

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

1 comment:

  1. North Shield Windows and Doors offers a wide selection of high-quality windows and doors. Among other features, our products offer the latest in security, durability, and design. We are homeowners too, that’s why we work within your style preferences to find exactly what you need and provide you with durable products that will keep your home safe. Windows replacement

    ReplyDelete

Cybermap

Internet Storm Center Infocon Status

Internet Storm Center Infocon Status
Internet Storm Center Infocon Status