|Screen Shots||Key Bindings||Todo List|
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!
The Main Window.
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.
- A search string. Enter this in the search entry.
- The files to search. Enter this in the files entry. You should include a path to the files you want to search, and append to the path the glob pattern for files in that directory in which you would like to search.
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.
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.
The following behavior of tclsed.tcl can be changed:
- The full path to files will be displayed if the "show full path" checkbutton is selected. This is off by default.
- The glob for files will operate recursively if the "recursive" checkbutton is selected. This is off by default.
- Backups of files that have been affected by the replace operation can be made if the "make backups" checkbutton is selected. This is on by default.
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.
<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