How search and replace works in TextPipe
Ordinary editors search one open file at a time and often fail on very large files. TextPipe applies find and replace rules to any number of files, of any size, without opening them in a window. Rules can be plain text, whole words, case-sensitive or case-insensitive, or full Perl-compatible regular expressions. You can also use fuzzy matching, such as sounds-like and edit distance, to catch misspellings that an exact search would miss.
Several rules can be chained in one filter list and run in a single pass over the data. Each rule sees the output of the previous one, so you can for example normalize spacing first, then replace a product name, then remove blank lines. The original files are left untouched unless you choose to overwrite them, and you can write results to a separate folder. A preview shows the effect on a sample before you commit to a full run.
Sample input and output
A web site export contains old domain names and inconsistent spacing:
Visit http://www.oldshop.example/products for details.
Email sales@oldshop.example today.
Three rules are applied in order: replace oldshop.example with newshop.example, replace http:// with https://, and collapse repeated spaces to one. The output is:
Visit https://www.newshop.example/products for details.
Email sales@newshop.example today.
A regular expression rule can go further. Replacing (\d{2})/(\d{2})/(\d{4}) with $3-$2-$1 rewrites every date from 14/03/2024 to 2024-03-14, using the captured groups in the replacement text.
Typical settings
- Match type: choose plain text, whole word, regular expression or fuzzy match, with or without case sensitivity.
- Scope: apply a rule to the whole file, to selected columns, or only to lines that match a second condition.
- Lists of replacements: load a table of find and replace pairs from a file to apply hundreds of changes in one run.
- Output: write to new files, a different folder, or back over the originals once you are satisfied.
Practical applications
Web teams update links and company names across thousands of pages after a domain change. Developers refactor identifiers in source trees. Database staff clean exports before loading them. Publishers apply a house style to a manuscript set. Because the filter list can be saved and run from the command line, the same replacements can be repeated each time a new batch of files arrives.
Common pitfalls
- A short find string can match inside longer words. Use whole-word matching or add boundaries in the expression.
- Rule order matters. If one rule changes text that a later rule searches for, the later rule may no longer match.
- Always run on a copy first. Keep the originals until you have checked the output.
Related pages
The search and replace feature guide lists every option, and the regular expression guide covers pattern syntax. To find matching lines without changing them, see grep. The publishing case study shows large-scale replacement in practice. For Word documents use WordPipe, and for spreadsheets use ExcelPipe.