tclsed.tcl
 
click here to return the the tcl.prehiti.net homepage
Description Usage Requirements
Screen Shots Key Bindings Todo List

Description

tclsed.tcl is a graphical search and replace application.  It can search and replace a simple expression in a group of files or a whole directory subtree.  It functions as a graphical version of grep (to some degree) and can even invoke an editor on selected files found in a search.

tclsed.tcl now handles the full regular expression syntax allowed in tcl without a million backslashes to escape special characters!

Screen Shots

The Main Window.

Usage

Searching

To search for a particular string in a set of files you need to specify two things.

Then hit the search button and you will see the main text widget update with the results.  It will pring "begin" when it starts and "end" when it is done.  If you see only begin and end, tclsed.tcl did not find any matching text.

tclsed.tcl will highlight all occurances of your search expression in its output.  It will also highlight the filenames of files in which the search expression was found.  Double clicking on the filenames will bring up the file in a text editor.

The files entry defaults to the directory tclsed.tcl was run from, followed by a glob for .cpp and .h files.
 
Replacing

To replace text, follow the steps in the "searching" section and also specify the replacement text in the replace entry field.  Then, all you have to do is hit the "do substitution" button and tclsed.tcl will do the rest.

It is often advisable to do a search first, in order to verify that your search critera is correct and not going to replace things you did not intend to be replaced.
 
Options

The following behavior of tclsed.tcl can be changed:

Command Line Args

tclsed.tcl currently has no command line options.

Included in the tcl.prehiti.net distribution is a script names "tclsed.tsh".  This is a command line, graphics-less version of tclsed.tcl.  The usage for tclsed.tsh is:

tclsed.tsh <search exp> <replace text> <filenames...>
tclsed.tsh always makes backups of files that had substitutions made.

Key Bindings

<Double-Escape> Exit
<F1> Do search
<Double-F2> Do replace
<Double-Button-1> (Left Mouse) Edit highlighted file in output window
<Button-3> (Right Mouse) Change word wrapping in output window
<Escape> Abort active search/replace

Requirements

Todo List
 
Bugs

General