Search and Replace Main Dialog
Search and Replace for Windows allows you to search for (and replace) a string in a set of files in a path you specify. You can also use Search and Replace as a file finder by leaving the Search string blank and entering a file mask & path. The found strings and the files they are found in are displayed in a list box using a customizable color (see General Options). The sort order of the files can be adjusted in Options-Search. Options-Output is used to change the information listed. Options-Filters can be used along with the mask and path to operate on some files but not others.
Click on the graphic below for help on the main window fields or scroll the screen down for a text description of the fields.
Details on the Main Window Fields:
Search String: Enter the string to search for in this field or select a previous search string from the combo list (). The search string you enter can be a simple search or a regular expression. To create a binary search using special characters, click the binary mode button to the right. The number of items saved in the combo lists is configurable in General Options. If you do not enter a Search String, the File Mask and Path fields will be used to execute a File Find, with the results displayed in the Search Results list.
Search String Binary Mode button (): Click this to use the Binary Mode dialog to create multiple line and/or special character Search Strings. When you are done creating a binary mode search string, “Binary mode –>>” is displayed on the main dialog. Binary mode strings will not be shown on the main screen. To view or edit the string, click the button again to activate the binary dialog.
Replace String: Enter the string to replace the search string with in this field or select a previous replace string from the combo list (). The string you enter can be a simple replacement, a regular expression, or a replacement involving special replacement operators. To create a binary replacement using special characters, click the binary mode button to the right of this field. Please See Word Documents Notes for important information on operations in non-text files such as Word documents, Word Perfect documents, spreadsheets, etc. Replacements are not made on files in ZIPs.
Replace String Binary Mode button (): Click this to use the Binary Mode dialog to create multiple line and/or special character Replace Strings. When you are done creating a binary mode Replace string, “Binary mode –>>” is displayed on the main dialog. To view or edit the string, later, click the button again.
File Mask: Enter a single file name or one or more include &/or exclude File Masks to specify the files &/or subdirectories to search. File and directory masks can be combined to create complex file mask expressions to include files in some subdirectories while excluding those in others. The wildcards characters * and ? may be used in a manner similar to the DOS dir command, e.g., *.*;*.txt;*.doc;*.??1. More than one mask can be specified by using a semicolon separator (see above). Exclude masks use the ~ character to denote a mask NOT to search (e.g., *.*;~*.swp;~*.exe;~*.dll). To specify a ~ character as part of the file mask, use \~ to denote the literal (e.g., *.*;\~*.tmp). If you have “Search ZIP Files” turned on, the mask will be applied to files inside of ZIP files as well as ordinary files in the path specified in the path field. Your last few search file masks are saved for you and you can find them in the combo box list (). See File Masks for more information.
You can also drag n drop one or more files from Explorer into the File Mask field.
When a script is active, this field may change to reflect the script in place, e.g., “Use Script file: xxx”, where xxx is the name of the script file.
File Mask Editor button (): Click this to activate the Include Exclude Files & Directories dialog. This dialog is used to help you generate complex mask expressions that will be ins
erted into the file mask field.
Search Path: Enter the path where files to search reside. You may type it by hand, navigate to it by using the Browse button (), or select a previously used path from the combo list ().
To search all local hard drives specify ‘Local Hard Drives’ (no quotes). To search shares you have access to on a UNC path, specify the UNC machine name (example: \\server10\ would search \\server10\c\ and \\server10\ docs\ if those are shares you have access rights to).
Don’t forget to enable ‘Search Subdirectories’ if you want to search files in paths below the entry in the Path field. To do this, click on the Search Subdirectories button or activate from the Flags Menu.
You can also drag n drop a folder from Explorer into the Path field to quickly enter a path.
Path Browse button (): Click to select the path where files to search reside via the Select Path dialog. If the Path field (described above) contains a valid path, it will be your starting path in the Select Path dialog. Otherwise, the current path will be used.
Search Results List: Your search results are displayed there. The information that is output to the Results list is configurable in Output Options, e.g., filenames, number of hits, hit lines, etc. The sort order of the files can be adjusted in Options-Search. The display colors of file names and strings found is configurable in General Options. If you’re having trouble seeing the results, try changing the colors. You can also enable/disable the tree-style list in Options-General. Double clicking on a line where a search string is displayed will display the View Context screen. The search hit tree can be expanded/collapsed by clicking on the / icons or Keyboard Shortcuts.F4/F5 move between files. The Enter key also activates the context viewer (Win95/NT version only). Double clicking on a line that lists a filename will launch the executable associated with that file, if one exists (e.g., in File Manager). You can also use the right mouse button to display a menu or use the Ctrl+C key to copy highlighted item(s) in the list box contents to the Clipboard. Also see Binary Search Results for a sample dialog if your files are binary.
Search Button: Click this button to start a search.
Search and Replace Button: Click this button to start a search and replace. We recommend that if you use this feature you also enter a backup path in the Options dialog (see Replace Options).