Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Created August 18, 2016 11:04
Show Gist options
  • Save bangonkali/8b2223aa23b250f6ba3830dc374ff542 to your computer and use it in GitHub Desktop.
Save bangonkali/8b2223aa23b250f6ba3830dc374ff542 to your computer and use it in GitHub Desktop.
Powershell script for string replace on Windows.

Replacement to another file.

cat DATA.TXT | % { $_ -replace "Mary","Susan" } > newfile.txt

Same file.

cat DATA.TXT | % { $_ -replace "Mary","Susan" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment