Builders

Builder

Find and replace text in files

List every file that contains some text, then replace it once the list looks right.

Run it once with Write the changes off. You get a list of files and match counts. When the list looks right, tick the box, copy the new script, and run it again.

Matching is exact and case-sensitive. Cat does not match cat.

Files are read as UTF-8 or UTF-16 and saved back the same way, byte-order mark included. A file saved in an older Windows encoding (often called ANSI), or a file that is not text at all, is listed as Skipped and left alone, because rewriting it could garble letters like é or ü. To include such a file, open it in Notepad, choose Save as, pick UTF-8, and run the script again.

Exact text, case-sensitive. Not a wildcard or regex.

Preview

find-replace.ps1