Skip to main content

Search and Replace in Files (SREPLACE.EXE)

TAKE COMMAND AND TCC VERSION 30 – SEARCH AND REPLACE IN FILES (SREPLACE.EXE)

I have been dissatisfied with the tools for searching and replacing text in files — something I need to do on a regular basis. I needed an app that would:

  • Automatically recognize ANSI and Unicode files (UTF8 and UTF16, with or without BOM’s).
  • Support the filename matching features of TCC (i.e., extended wildcards and regular expressions).
  • Process all of the matching files in a subdirectory tree.
  • Support either simple text matching or full regular expressions.
  • Match the preferred regular expression  syntax chosen in TCC (i.e., Perl, Java, Python, grep, etc.).
  • Provide both an interactive and a batch processing mode. 
  • When in interactive mode, show the original and replacement text, and allow selecting / deselecting individual matches in the files before the replacements are done. 
  • Load xml scripts to perform the batch mode processing.

I couldn’t find anything that satisfied all the requirements, so I decided to write my own. SReplace (available either from the Take Command tools menu or from the TCC command line) is the result.

I plan to expand SReplace’s features in the next few versions; if you have any ideas please post them in the JP Software Suggestions Forum.

Take Command / TCC / CMDebug v31 Call for Feature Requests

Version 30 was released last week, and we’re starting to plan what will be in version 31. If you have requests, post them in our Suggestions Forum.