Search and Replace Help Contents

Search and Replace for Windows Help Overview

Search and Replace for Windows Ó is a search (grep) utility that can find (and replace) one or more strings in multiple files, including files in ZIP archives. Operations can be done using simple search-replace, regular expressions, and scripts. Please see the Feature List for an outline of the many functions available.

Product Information

Purchase Information

Shareware Information

License Information

Customer Support

Acknowledgments

International Versions

Funduc Software Products

READ ME FIRST

Word Docs & Replacements

Basic Operations

Features List

Main Window

Program Options

Program Menus

Keyboard Shortcuts

Command Line Switches

Script Operations

Windows Find Menu

Touch Files

Find Files / File Operations

How To Topics

Quick Guide

Complex File Masks

Regular Expressions

Search Operators

Replacement Operators

Examples

Special Replace Operators

Binary Mode Dialog

Print & Save Search Results

Undo Function

Search & Replace Main Window


General Notes

Search and Replace is a general purpose windows search/replace utility that is oriented towards text-based files such as program code, html code, java code, xml code, log files, text documents, text-based database exports, etc.

Search and Replace does not care what kind of file you search. It can even search in program .exe's if you let it. "Readable" text can often be found in most files.

However, the program does not have internal file conversion or viewer routines for search (or replace) in Microsoft Word™ DOC files, Excel™ XLS files, Access™ MDF database files, Outlook™ .pst files, Corel Word Perfect™ DOC files, or Adobe Acrobat™ .pdf files. You can use the program to search these and other files but the search results will be returned as 'binary offsets'. Replaces can be done under some conditions but you need to be careful. Please see Word Document Notes for more information.

Adobe Acrobat™ .pdf files present a special situation. The Acrobat compiler compresses the file when preparing the pdf. Accordingly, a finished .pdf file has very little readable text. Searches with Search and Replace will likely not be fruitful.


Operating System Compatibility

Search and Replace runs on Windows 2000, XP (Pro and Home), Windows 2003, Windows Vista (all versions), Windows 7 (all versions). Separate 32-bit and 64-bit (x64) versions are available.

Notes:

  • 64-bit users: You should install the 64-bit version. The 32-bit version shell extension will not work on x64 operating systems.

  • If you are unsure about whether your operating system is 32-bit or 64-bit, see the www page at http://www.funduc.com/comp_ver_info.htm.

  • Windows NT users: Windows NT is no longer officially supported. At minimum you must have Service Pac 6.

  • Windows 95, 98, & ME users: These systems are no longer officially supported. At minimum you must have the latest patched versions that were available from Microsoft at the end of the product lifecycles for these operation systems. Please note we cannot guarantee future compatibility as these operating systems and the hardware they run on are now outdated.


Word Document Notes

Also See General Notes

Search and Replace is a very powerful program! It is oriented toward text files such as program code, html code, log files, text documents, etc. However, if you permit it do so, Search and Replace will do search/replaces in any file where your search string is found. It will can also perform replaces in "binary files" such as Microsoft Word™ DOC files, Excel™ XLS files, Access™ MDF database files, Outlook™ .pst files, Corel Word Perfect™ DOC files, Adobe Acrobat™ .pdf files, and so on. Furthermore, Binary Mode search / replace is not a requirement. Readable, ASCII text is almost always present in these types of files. 'Also in executable program files (.exe's). If a simple ASCII text string exists in a "binary file", Search and Replace will find it.

Sample Results - Binary File Being Searched

Search-only operations are OK on any kind of file. If you make replacements in a file that Search and Replace detects as a 'binary' file and if you did not disable replacement prompts (Options-Replace), a notice message is presented. Use care if you make replacements. Please aware that native &/or proprietary format files such as word processing documents, database files, and spread sheets, contain internal counters that will probably be thrown out of synch if casual replacing is done. If this happens the application that created the file probably will not be able to read it again and your data will be lost. For example, if you find the text "Funduc Software" in a Word doc and replace it to "Funduc Software, Inc", Word would probably not be able to load the file afterwards.

Unless you are an advanced user, you should only make replaces in ASCII text files only such as .HTM, .RTF, .TXT, .INI, .C, .CPP, .H, etc.

See External Editors for information on configuring your Search and Replace installation to use an external binary editor when your results involve a binary file.

Replaces in most binary files can probably be done safely if you abide by the following rule: Replace strings must be exactly the same length as the search string. For example, '2000' can probably be replaced safely with '2001' because the strings are exactly the same length.

Be sure to back up your files before you experiment!!!

If you are making replaces that are a different length that the search string you should convert your Word, Word Perfect files (and others) to RTF format before you operate on them. With careful use, you will have good results.

Important .rtf file Notes

.rtf files are plain text but they are specialized files!! Some things you need to be aware of include:

  • Some characters that you see in your word processor do not exist in that same form in the actual RTF file. For example, the À character in a MS Word .rtf may be coded as \\'c1 the .rtf file itself. Write support@funduc.com if you are interested in a conversion script that can be used with the 'Apply Script' function.

  • Line breaks in the .rtf file itself may not match what you see your word processor. For example, line breaks can be present in between two words even though those words are on the same line when you view the document in your word processor. The 'Ignore Whitespace' may be helpful in this regard.

  • Take care that you not to damage RTF code related to formatting. This is similar to working on HTML files. It is your responsibility to make sure RTF (or HTML) code features are not disturbed unintentionally. This is why we strongly advise you keep good back ups of your files.

If you are working on spread sheets or database files, export your data to ascii form before making replaces that are a different length than the search string. Import your modified data back into your spreadsheet/database afterward.

If you need to make only a few casual replaces in your Word or Excel files, take a look at our Word SR and Excel SR products.

Other notes:

  • Be sure to define a backup path in Options-Replace and experiment on non-critical files.

  • If you are dealing with .doc's and are unfamiliar with the rtf format, do some simple searches and use the Context Viewer to see the context surrounding your search hit. Also consider using your text editor or file viewer. rtf is similar to html - there are opening & closing codes that you should not disturb except by intention.

  • Begin by doing simple search/replace only. Casual use of regular expressions may cause problems if you inadvertently change closing & ending codes.

  • Check your work by loading your experimental file back into the editor before moving on to important data.

  • Use extra care if you try to modify data related to advanced features or features such as document properties or a query or a formatting item. The 'same length' rule noted above may not work.


Quick How-To Guide

Start a search: Enter (or select from the [image] combo boxes) a search string, one or more file masks, and a path. (You can drag n drop a specific file from Windows Explorer into the File Mask field). Then click the Search button. See Search and Replace Main Window for more information. ZIP files are searched by default. To configure that and many other items, see Program Options. Note: To conduct a new search across only those files that are currently in the Search Results list from a previous search, press CTRL+ALT as you click on Search.

Use Special Characters or Multiple Lines in Search or Replace: Click the [image] button to the right of the Search or Replace String fields to use multiple lines or special characters in that field via the Binary Mode dialog. When you are done, the string "Binary mode -->>" will be displayed. To view the string later, click the [image] button again.

Add Lines to the Beginning or End of Files: Enter string to add in the Replace string field in the main dialog. Next, activate the Search String Binary Mode dialog ( [image] button and mark either "Add at top of file" or "Add at bottom of file". Click the "OK" button. Click the "Srch & Repl" button on the main dialog and the Replace string will be inserted according to your choice.

Use Include &/or Exclude File Masks: File masks follow the syntax of the DOS dir command (e.g., *.*;*.txt;*.doc;*.??1). More than one mask can be specified via a semicolon separator. Exclude masks use the ~ character to denote a mask NOT to search (e.g., *.*;~*.swp;~*.exe;~*.dll). To specify the ~ character as literal in a mask, use \~ (e.g., *.*;\~*.tmp). See File Masks for more information.

Start a replace (registered version only): Enter (or select from the [image] combo boxes) a search string, a replace string, one or more file masks and a path. Then click on the Search & Replace button. See Search and Replace Main dialog for more information. Please See Word Document Notes for important information on search & replaces in non-text files such as Word documents, Word Perfect documents, spreadsheets, etc. Also note: Replacements are not performed on files in ZIPs.

Change Options: Click on the Options button or select Options from the View menu on the menu bar. Among the options you can change are the display colors, replacement prompts, a file (or printer) to write the output to, the number of items to save in the combo boxes, search filters, etc. See Options for more information.

View the Context of a Search Result: Double-click the Search Result or click the right (left for left-handers) mouse button and use the pop-up menu. The internal context viewer can only display text files. However, Search and Replace can automatically view binary files using our external utility, HexView for Windows 95/NT. The registered version allows you to edit the file using the internal context viewer.

Open a File Listed in Search Results: To open the file using the associated program, double-click the "Processing file..." line in the Search Results or click the right (left for left-handers) mouse button and use the pop-up menu.

Use Regular Expressions: Regular Expressions are supported for both Search and Replace (the shareware permits replacements in the first five files of a program session). Enter an expression in the Search field, a counterpart expression in the Replace field (for a search & replace operation), and click on the Search (or Srch & Repl) button. See Regular Expressions for more information.

Use Scripts for Multiple Search and Replace strings or Paths: Click the "Script" button to activate the Script Dialog to process multiple Search/Replace strings, paths and file masks.

Use Scripts to Process Search / Replace Strings: You can use a script to transform your search &/or replace strings in advance of a latter operation. Develop the script you need and activate the Binary Mode dialog to use the Apply Script function. Note: Press CTRL+Binary Mode button to quickly insert the current search/replace string into the respective binary mode dialog.

Use Command Line Parameters: See Command Line Parameters. For all practical purposes, only the Windows 95/NT version can be used from the command line.

Find Files only: Enter one or more file masks and a path. Do not enter a Search String (or blank it out). Then click on the Search button. See Find Files for more information.

Touch Files: To Touch Files , enter (or select from the [image] combo boxes) one or more file masks and a path. Enter any filter options you desire to exclude files by file date &/or file size. Use 'Touch' from the Actions Menu or the Touch toolbar button. The touch dialog will prompt you for the date, time, and file attributes to use for all the files described by your settings. Using Touch this way affects all files that meet your path, mask, & filter criteria. If you want to touch specific files, perform a search highlight one or more files in the Search Results list, and use 'Touch Selected Files' on the context menu.

Search ZIP Files: Check the "Search ZIP files" field on the main screen to enable searches in PKZIP-compatible ZIP files that are present in the search path(s). Any files matching the file masks and filter options specified will be extracted to the extract path specified under Search Options and searched. ZIP searching may slow down operations so you turn it off if you do not need it. It is not necessary to specify *.zip on the file mask field to search ZIP files - simply check the box. Note: Replacements are not made on files in ZIPs.

Write Search Results List to a File: The information in the Search Results area of the main dialog can be dumped to a text file by specifying a path & file to write the results to in the "Write Output to File" field under Output Options . The display options under the Output Options dialog are reflected in the output file, e.g., options such as whether filenames are included and the delimiters before &/or after search hits.

View Search Results as HTML: To generate an HTML version of the Search Results and launch your browser, select "View Results as HTML" from the Context Menu or the Edit Menu.

Print the Search Results List: To send the Search Results to your printer, either:

  • Select "Print Search Results" from the Context Menu or the Edit Menu to send a copy of the search results list to your printer. Depending on your computer setup, you will be presented with a standard Windows printer select dialog before the results are printed.

  • Go to Output Options and enter the phrase "Default Printer" (case insensitive, no quote characters) in the "Write Output to File" field. As with a dump to file (see above), the display settings under Output Options will be reflected in the printed output. Long lines will be wrapped. To turn off printing, return to Output Options, delete the string Default Printer from the "Write Output to File" field, and save the change by pressing the OK button.


Search and Replace Feature Overview

Overview of Search and Replace Features

Search and Replace for Windows is a search (grep) utility you can use to find a string in multiple files, including files in ZIP archives . The registered version allows you to replace some, all, or none of the strings with another string. The shareware version will make replacements in the first five files per session. Here is a list of the basic features.

  • Regular Expression operators include the basic grep-style substring and match operators, along with special replacement operators such as case change operators, file and path name replacements, counters, and binary mode operators.

  • Search and replace operations can be case sensitive or not, they can span multiple files via multiple file masks and filter settings, and they can span more than one line. The program can search-replace the Windows Clipboard (see Clipboard Search-Replace). You can do simple searches in the Search Results list (press F3) and you can also limit follow-up search &/or replace to only those files currently listed in the Search Results list.

  • Unicode files are detected automatically for seamless search/replacing.

  • UTF-8 encoded files are handled directly if the name extension is .xml.

  • Perform replacements that do math operations on strings that consist of numbers.

  • The Internal context viewer allows you to edit text files (See Main Window ). You can also launch a user configurable external viewer with optional special commands (see General Options ), launch associated programs on "found" files and automatically view binary files using our freeware companion utility, HexView . You can also disable the internal context viewer and use an external viewer/editor.

  • Binary Mode search and replace lets you process binary files &/or text files with special characters such as tabs, line feed, carriage returns. Binary mode also allows you to prepend or append the replace string to files and reformat files at a specified column.

  • HTML Mode permits the program to automatically handle character code transformations for html special characters. For example, find "Search & Replace" even though the raw string is "Search &amp; Replace" in your html document.

  • Simple boolean searches using &, |, or ~ characters for 'AND', 'OR' and 'NOT' can be used in the main dialog search field when 'Whole Word' mode is enabled and 'Regular Expressions' and HTML Mode' are disabled.

  • Ignore Whitespace mode allows you to ignore extra space and \r \n \t characters without needing to use a regular expression.

  • File operations (copy, move, delete) can be done on files in the search results list.

  • Search (replace) subdirectories or not and also limit how far the program will go with subdirectories.

  • Multiple include & exclude File Masks let you, for example, search all ".htm" & ".html" files except the ".htm" files begin with "s" or "t". You can also create Complex File Masks to include some subdirectories while excluding others. In addition, Filter Options allow you, for example, to include only files created after a set date that are smaller than the size you specify.

  • The program will search all local hard disks if 'Local Hard Drives' (no quotes) is specified in the Path field. To search shares you have access to on a UNC path, specify the UNC machine name in the Path field. See Search Path for more information.

  • Incrementing counter operations let you allow you to quickly revise a sequence of numbers in one or more files or add numbers where no numbers exist originally.

  • Scripts let you easily specify multiple search/replace combinations, save a particular search or replace string for later use, or process multiple drives/directories and/or file masks. Advanced Script Settings let you control program options, embed comments in scripts, and further specify the files processed during a script operation via a boolean expression evaluator. Scripts can also be caused to repeated via an Iteration Operator and you can chain scripts using Linked Script references.

  • Shortcut keys for scripts include: a) CTRL + Main Dialog Script Button - writes all program settings to SRDUMP.SRS in the same path as sr32.exe, b) CTRL+ Insert in Script Dialog - Inserts the respective lines from the main dialog into that script dialog tab, c) CTRL+ Remove All in Script Dialog - Deletes all current entries and add respective lines from the main dialog into that script dialog tab.

  • Scripts can be applied to the Search &/or Replace strings in advance of an operation. Activated via the Apply Script function, you can, for example, use a conversion script to deal with the plain text equivalents of html special characters or rtf 'escape' codes.

  • Replacements, including those in script and binary operations, can be visualized in context before they are made.

  • User control over replacement prompts/warnings includes one string at a time, one file at a time, all at once (no warnings), and combinations in between such as skipping all remaining occurrences in a file (see Replace Options).

  • Undo the last replacement(s) made via the Undo function.

  • Searching can be halted after the first hit in a file - useful for when you have to search large or many files (See Search Options).

  • Write files changed by a replacement operation to a backup directory and preserve original file time/date stamps during replacements (see Replace Options).

  • Add text to the top of a file or the end of the file (see Binary Mode Dialog ).

  • Insert the path & filename in replacements via Special Replacement Operators.

  • Use Environment Variables in the search &/or replace strings.

  • Output in the Search & Replace "Results List" can be directed to your printer , saved to a text file, or viewed automatically in your web browser.

  • Files &/or directories dropped from Explorer or File Manger into the Search & Replace main window are automatically recognized for processing. Just drag a file into the Search and Replace window!

  • Launch Search and Replace from a program menu item on the Find Menu. The Explorer shell extension lets you launch Search & Replace on a specific file or group of selected files.

  • A full complement of command line switches - ideal for power users. A switch is available to cause the program to run without any user interface (/u switch).

  • User configurable fonts & colors.

  • Touch to change the date and time of the files you specify. Touch also allows you to set the file attribute bit (Archive, Read Only, Hidden, System).


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 ( [image]). 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 ( [image] ): 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 [image] 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 ( [image]). 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 ( [image] ): 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 ( [image]). See File Masks for more information.

Notes:

  • 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 ( [image] ): Click this to activate the Include Exclude Files & Directories dialog. This dialog is used to help you generate complex mask expressions that will be inserted 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 ( [image]), or select a previously used path from the combo list ( [image]).

Notes:

  • 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).

  • Filters and Complex File Mask expressions to further specify which files in the path will be processed.

  • 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 ( [image] ): 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 [image] / [image] 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).


Search Results List - Binary Files

If Search and Replace determines that the file being searched is a binary file the Search Results list switches to a display of 'offset' information as shown in the image below.

Please see Word Document Notes for important information about replaces in binary files!!

See External Editors for information on configuring Search and Replace to use an external hex file editor for the View Context tool when results are in a binary file.

Sample Results - Binary File Being Searched


Binary File Replacement Warning

The above warning message is provided if replacement confirmations are enabled (Options-Replace) and if Search and Replace detects that a replacement is about to be made in a 'binary' file such as an .exe file, word processing document, spreadsheet, graphics image, etc.

See Word Document Notes for more information about replaces in proprietary format files such as .doc, .xls, .mdb, .pdf, and so on.

To disable this prompt, turn off replacement confirmations in Options-Replace.


Internal Context Viewer

This dialog allows you to view and edit (registered version only) the lines around where the search string was found. Click on the graphic below for help or scroll your display down for additional details.

Note: With v 4.6+ you can configure the program to use the external editor specified in the Options|General ''If no association use" field in lieu of the internal context viewer. See External Context Viewer for more information.

To activate the View Context dialog, highlight a search string find in the Search Results area of the main window and then either double click or select View Context from the right click menu or the View Menu. The Enter key also activates the context viewer.

The context viewer displays text only. However, Search and Replace will automatically detect binary files and launch our freeware companion utility, HexView, which can display and print any file as a hex dump. HexView can be downloaded from our web site at http://www.funduc.com.

The display font and number of lines to view in the View Context dialog is configurable under General Options.

You can perform the usual editing operations in this field by using the keyboard as follows:

Copy | Ctrl+C
Paste | Ctrl+V
Cut | Ctrl+X
Undo | Ctrl+Z

The following keyboard shortcuts are available:

CTRL+PgUp | Previous Search hit
CTRL+PgDown | Next Search hit

Details on the View Context Dialog Fields:

Save button: The changes will be made (registered version only). If the file is in a ZIP file, it is extracted to a subdirectory of the path specified in Options. If you edit a file in a ZIP you must then update the ZIP manually since it is NOT automatically updated. If you need a ZIP utility, take a look at our own Directory Toolkit.

Cancel button: The changes will not be made.

Page Up button: Displays the block of lines above the current block. The PgUp key on your keyboard does the same thing.

Page Down button: Displays the block of lines below the current block. The PgDn key does the same thing.


External Context Viewer

By default, Search and Replace uses an Internal Context Viewer to display the context of search hits when you double click on a hit line. As of v 4.6 the program can use the viewer/editor specified in Options|General 'If no association use' field (see External Editors).

Currently this feature can be activated via a manual registry change or the special configuration utility on our www site. Please write support@funduc.com for information.

If you want to make the setting manually, see the Special Registry Switches topic and scroll to 'Disable Internal Context Viewer' section.


Right Click Context Menu

The 'right click' Context Menu in the main dialog is activated by highlighting any line in the Search Results List and right clicking with the mouse. Left click if your mouse is set up for left-handed use. Some functions may not be available depending on whether the filename or a replace string is highlighted.

For more information, click on the below graphic.


Replace Confirmation Dialog

Note: See Advanced Scripts & Replacement Prompts for details about the impact of replacement prompts on Advanced Script operations.

Click on the graphic below for help on the Replace Confirmation fields.

Details on Replace Confirmation Fields:

Found String List: The list at the top of the confirmation dialog provides information about the replacement context. Replacement strings are always listed. If you have 'Display First Hit Line' enabled in Options-Output, the search hit line will be listed. Double click on the search hit to display the View Context dialog and see more of the context of the pending replacement. You can also highlight one or more lines in the dialog and copy them to the clipboard with CTRL+C or from the mouse right click menu.

Replace This button: This single occurrence of the string will be replaced. The next prompt will be for the next hit, if any.

Replace Rest In File button: The pending replacement and all other occurrences in the current file will be replaced. The next prompt will in the next file, if any.

Replace Rest In Directory button: The pending replacement and all occurrences in all files in the same directory as this file will be replaced. The next prompt will be for the first file in the next directory, if any.

Replace All Remaining button: The pending replacement and all other occurrences in all files to be processed will be replaced. No more prompts will be offered until the end of the operation.

Skip This button: This one replace will be skipped. The next prompt will be at the next hit, if any.

Skip Rest of File button: The pending replacement and all others in the current file will be skipped. The next prompt will be for the next file, if any.

Skip Rest In Directory button: The pending replacement and all others in the remaining files in the directory will be skipped. The next prompt will be for the next file in the next directory, if any.

Cancel Remaining button: Abort the entire operation. The pending replacement and all others will be canceled.


Undo Replacments

Undo Last Replacement

The last replacements made can be reversed in some instances using a batch file named "SRUNDO.BAT" that is automatically generated with each replace operation. SRUNDO.BAT is written to the same subdirectory as backup path (see Replace Options). You should run SRUNDO.BAT manually from Explorer, the Start Menu 'Run' function, File Manager, or a command shell.

SRUNDO.BAT should be used with care and you should not rely on it as a guaranteed safety net for recovery from poorly planned replacement operations.

Keep the following cautions in mind:

  • SRUNDO.BAT is not created if you do not have a Backup Path established in Replace Options.

  • For Script operations involving more than one replacement, SRUNDO.BAT will only reverse the last replacement step.

  • SRUNDO.BAT is intended for advanced users.

  • SRUNDO.BAT cannot currently be run from within Search and Replace itself. You must run it manually.

  • In some network situations, the success of SRUNDO.BAT may be affected by your network access parameters and drive mapping permissions. For example, under some networking arrangements, although Search and Replace work fine with UNC paths, DOS access those same UNC paths may not be permitted. Consider mapping your network paths to a drive letter.


No Files Found

Search and Replace was unable to locate any files using the parameters you specified. This does not necessarily mean an error occurred - it could be that there simply are no 'hits' using your search string, file mask, paths, filter, and advanced script settings.

If you are surprised to get no results, go to Output Options and turn on "Display Files Without Hits". This directs Search and Replace to list the files processed according to your file mask, path, and filter criteria. If no files are listed, then your criteria resulted in no files being selected for a search (see below). Conversely, if one or more files are listed as being processed and you are getting a "No Occurrences Found" message, then your search string simply isn't present in any of the files processed. If you expect some hits on your search string, double check your intentions regarding the Case Sensitive and Match Whole Word flags, Regular Expression syntax, and Binary Mode searching.

If no files at all are being processed, double check your File Mask, path, and filter settings. Double check your Search Options settings for Zip searching & the size of regular expression searches.


Subdirectory Search/Replace

Subdirectory search/replace is enabled via the Main Window Toolbar button or Flags Menu. When enabled, the program will also process paths under the path specified in the Path field.

For script operations, Subdirectory search/replace is enabled /disabled as follows:

  • If 'Use Program Options' is selected in the Scripts-Advanced tab, the script follows the subdirectory setting currently in effect for the program. The 'Search Subdirectories' field on the Scripts-Advanced tab is dim and not available.

  • If you specify different Options for your script, the 'Use Program Options' checkbox in Scripts-Advanced will be unchecked and 'Search Subdirectories' is now available to be changed.

Subdirectory searching will usually slow your search so turn it off if you only need to search the specified path.

Note: As of v 4.6 you can limit how deeply the program will recurse within subdirectories. See the Special Registry Switches topic and scroll to the ' Limit Subdir Recurse Levels' section. Alternatively the switch can be set using the special configuration utility on our www site. Visit the Search and Replace page to download the utility.


Subdirectory Search/Replace - Limiting

Basic subdirectory search-replace is controlled from the main window toolbar or the Advanced Tab in the script editor.

As of v 4.6 you can also limit how deeply the program will recurse within subdirectories. See the Special Registry Switches topic and scroll to the ' Limit Subdir Recurse Levels' section. Alternatively the switch can be set using the special configuration utility on our www site. Visit the Search and Replace page to download the utility.


Case Sensitive Flag

Case Sensitive Flags

Case Sensitive is enabled/disabled via the Main Window Toolbar button or Flags Menu and the Script Editor . This switch determines whether Search & Replace will perform an exact case search (& replace). Note that if you want a replacement to be case sensitive, you must define a case sensitive search.


Ignore Whitespace Mode

Ignore Whitespace Mode can be enable from the toolbar, Flags Menu, or in Scripts. When enabled, Search and Replace will ignore extra spaces and \r (CR), \n (LF), \t (Tab) characters between whole words. This allows you to easily find, for example, the string "IMG SRC=" in both

bgcolor="#FFFFCC"><IMG SRC="divider.jpg" width
and
bgcolor="#FFFFCC"><IMG
SRC="divider2.jpg" width

without using a regular expression search.

Notes:

  • Replaces done with Ignore Whitespace ON do not replace the intervening extra spaces, or \r \n \t characters. In the example above, a replace involving "IMG SRC=" with Ignore Whitespace ON would remove the CR-LF and extra spaces in the second instance. You may wish to use this behavior to your advantage, perhaps to clean up files. If you do not want this to occur during a replace, use a Regular Expression search/replace instead.

  • When Regular Expressions is turned on, Ignore Whitespace is not available.

  • Your search string must contain one (or more) of the 'ignore strings' in the position(s) where the whitespace characters exist in your file(s) for Ignore Whitespace to work. For example, Ignore Whitepace would not locate the search string "SRC="divider.jpg" separated across two lines because no spaces are present.


Whole Word Mode

Whole Word Mode can be enable from the toolbar, Flags Menu, or in Scripts. When enabled, Search and Replace searches for strings you provide surrounded by <space> or one of the other characters listed below. The most common use of Whole Word is to find a string but not if that string is present within another 'word'. For example, when Whole Word is not enabled, a search for 'plane' finds that string in 'airplane', 'planes', 'planet', etc. When enabled, none of these hits would occur.

Whole Word Mode is also used to carry out Direct Boolean Expressions.

Notes:

  • Whole Word Mode is not available when Regular Expression mode is enabled.

  • The delimiter characters are (using the ASCII table):
    <000> thru / : thru @ [ thru ` { thru ¿

  • Spaces are interpreted literally. For example, 'find me' looks for that literal phrase, not the single words 'find' and 'me'.


HTML Mode

HTML Mode is activated from the Flags Menu or the Toolbar button .

When enabled, search and replace operations will automatically make ISO plain text character code substitutions for the HTML special characters.

If a replacement is being made that involves a character for which there is an html special character code, the character code will be used. For example, if "x < y" is specified in a Replace field, "x &lt; y" is replaced in the document. You can visualize this in the replacement confirmation dialog by enabling replace confirmations (Options-Replace) or by enabling the display of replacement strings (Options-Output) and then performing a search. HTML Mode is not available when Regular Expressions are on. See HTML Mode for more information.

HTML Mode is not available when Regular Expressions are on.

For a complete list of the HTML Special Characters, please follow the links off our Search and Replace page on our web site (http://www.funduc.com/search_replace.htm).


File Masks

File Masks: Include & Exclude Masks

File Masks are file and directory name filters, which, in conjunction with the search path, size & date filters, and advanced script settings, define the files Search and Replace will operate on. 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). One or more specific files can be searched by entering the file name(s) in the file mask field and the path in the Path field. Separate multiple names with the ; character, e.g., index.html;searchthis.htm.

You can also drag n drop files from Windows Explorer into the file mask field. Folders can be drag n dropped from Explorer into the Path field.

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 on the main screen. Be sure not have any blank spaces between the semicolon(s) and the mask(s).

Search and Replace saves your last few file masks in the combo box list ( [image]) to the right of the File Mask field.

Include Masks: These are the masks as outlined above. For example, to include all files of the filetype .html in a search, you would use the mask *.html. Of note, if you wanted to also include .htm files, you could use the mask *.htm* or use a semicolon separator and create two masks, *.html;*.htm. See complex file masks for help on adding mask expressions involving subdirectories.

Exclude Masks: the ~ character denotes a mask NOT to search. For example, if you wanted to exclude all .exe and .dll files from your search, you would use the mask *.*;~*.exe;~*.dll. Here, all files but .exe and .dll files would be included. Note the use of the semicolon separators. See complex file masks for help on adding mask expressions involving subdirectories.

To specify the ~ character as an explicit part of a filename, use \~ to denote the literal. For example, a mask to include the files named ~1.txt and ~2.txt would be \~*.txt. To create an exclude mask for those files, use the mask, ~\~*.txt.


Include/Exclude Mask Builder

Include/Exclude Files & Directories

The Include/Exclude Files and Directories dialog is activated from the [image] button next to the File Mask fields in the main window and the script dialog. This editor is used to construct complex expressions to insert in the file mask fields. These expressions allow you to further specify which subdirectories and files under the search path to include (or exclude) from your search &/or replace. For example, it is possible to exclude files of one type in some subdirectories while including files of the same type if they reside in other subdirectories. You may use the * and ? wildcards as in the DOS dir command to refer to subdirectories.

To enable complex Include/Exclude masks, be sure to turn on the "Search Subdirectories" field in the Main Window or the Advanced Script dialog!

Click on the graphic below for help on the main window fields or scroll the screen down for a text description of the fields and additional notes.

Details on the Include/Exclude Files and Directories dialog:

Include Exclude Mask List: The list of masks that will be inserted into the mask field when you click the OK button. Each expression here will be combined as a single expression separated by semi-colons.

Include Exclude Mask Buttons:

Up Button: Moves the highlighted mask in the Include/Exclude list up one step.

Down Button: Moves the highlighted mask in the Include/Exclude list down one step.

Apply Button: Creates a mask in the Include/Exclude list for the data listed in the fields on the right side of the dialog.

Add Button: Creates a new blank mask at the bottom of the Include/Exclude Mask list.

Insert Button: Inserts a blank mask in the Include/Exclude list above the highlighted line.

Delete Button: Deletes the highlighted mask in the Include/Exclude list.

Include Field: Mark this to have the data in the other fields to the right of the dialog be an "include" mask.

Exclude Field: Mark this to have the data in the other fields to the right of the dialog be an "exclude" mask.

Files Matching Field: Enter either a specific filename or a wild card expression to use. The wildcard operators are the same as the DOS dir command, e.g., the ? and * characters may be used. "Files Matching" may be used alone to specify a general include or exclude file mask or it may be combined with data involving the "Directories Matching" field below to identify files in some directories but not others.

Directories Matching Field: Enter a directory name or a wildcard specified directory name to use. The wildcard operators are the same as the DOS dir command, e.g., the ? and * characters may be used.

All Field: Mark this to use only the data in the "Files Matching" field. The "All" field is mutually exclusive with the "Use Match" field. To use data in your mask from both the "Files Matching" and "Directories Matching", mark the "Use Match" field.

Use Match Field: Mark this to use an expression involving a subdirectory name specified in the "Directories Matching" field. The "Use Match" field is mutually exclusive with the "All" field. To use data in your mask from both the "Files Matching" and "Directories Matching", mark the "Use Match" field.

Any Number of Levels Under Start Directory Field:

a) Leave this unmarked to include (or exclude) the directory specified in the "Directories Matching" field that exists immediately under the start path directory. For example, given the staring path c:\test\, the expression ~\skip_me\ would skip the files in c:\test\skip_me\. However, files in c:\test\more\skip_me\ or c:\test\skip_me\test2\ would be processed. To also skip files in subdirectories under c:\test\skip_me\test2\, turn on the "Also Process Subdirectories" field.

b) Mark this to include (or exclude) the directory specified in the "Directories Matching" field no matter how many levels below the start path directory it exists. For example, the expression ~\*\skip_me\ would exclude the files in c:\test\skip_me\ and c:\test\more\skip_me\. Files in subdirectories under c:\test\skip_me\ and c:\test\more\skip_me\ that are not named "skip_me" would be processed, e.g., c:\test\more\skip_me\more2. To also skip files in 'more2', turn on the that "Also Process Subdirectories" field.

Also Process Subdirectories Field: Mark this field to include (or exclude) subdirectories below the directory specified in the "Directories Matching" field. For example, given the start path c:\test\ and the expression ~\skip_me\*\, all subdirectories under c:\test\skip_me\ would be excluded. Note that if "Also Process Subdirectories" was not checked (e.g., an expression such as ~\skip_me\), files in c:\test\skip_me\ would be excluded but files in c:\test\skip_me\test2\ would be included.

OK Button: Inserts the items in the mask list into the File Mask field in the main dialog.

Cancel Button: Quits the dialog without making changes.

Help Button: This will probably activate the online help :-).

Notes on Complex File Masks:

  • To enable complex Include/Exclude masks, be sure to turn on the "Search Subdirectories" field in the Main Window or the Advanced Script dialog!

  • The program builds the complex file masks from left -> right. In general, specify masks to include first, followed by excludes. For example, ~\images\i*.txt;*.* is not recommended. Use *.*;~\images\i*.txt instead.

  • The rules for complex masks are perhaps best understood by example. Use the below chart as a guide and experiment with the dialog on temporary data before using complex masks on critical data.

  • By way of a general explanation in words:

  • - When a string involving the * meta character is followed by a \ character a subdirectory is referenced. For example, \*mage*\, \*mages\, \image*\ refer to subdirs.

  • \*\ preceding a subdir specification refers to 'any number of levels below the parent search path. For example, ~\*\test\ excludes any paths named test any number of levels below the starting search path.

  • \*\ following a subdir specification can be thought of as 'and also any subdir level below that point. For example, ~\test\*\ excludes \test immediately under the starting search path and all paths under \test. A path named \whatever\test would be searched.

  • \*\ surrounding a path means 'any number of levels below the parent search path and also everything under that. For example, ~\*\test\*\ would exclude any path named test at any point under the parent search path. Following from the above, ~\*\test\*\ would not search \whatever\test.

  • File mask specifications can be supplied after the closing \ for a subdir reference. If you don't use * in the path reference you must specify * after the \ character. For example, *.*;~\images\* should be used and not *.*;~\images\ alone. In contrast, the program assumes a file spec of *.* if the * character is used in a path reference. For example, ~\image*\ is interpreted as ~\image*\*, which is the same as ~\image*\*.*.

  • Complex file masks can be used in combination with subdir references. For example, *.*;~\test\*.txt excludes *.txt files in \test\ but search all other files under \test

  • The examples below are oriented toward excluding subdirs/files but you can use complex notation as an include. See below.

  • When referencing files, * alone can be used. As most Windows files have a single . character in them this is the same as *.*

  • It is OK to divide complex exclude masks into separate components separated by the ; character. For example, a mask to exclude all files named test* in all subdirs and also subdir names that begin with \test are best divided into separate components. See below.

    • Expression | Effect
*.*;~\images\* | Skip files in the images subdir right below the starting path for the search. You could also use *.*;~\images\*.*
*.*;~\images\*\ | As above but also skips subdirs under images
*.*;~\*\images\*\ | Skip files in any subdir named images
*.*;~\*\images\*.jpg | Skip .JPG files in an images subdir any # of levels below the start path
*.*;~\* | Skip files in the 'root' of the Path field.
*.*;~\images\test\ | Skip files in images\test. *.*;~\images\test\*.* does the same thing.
*.*;~\images\te*\ | Skip files in images\test, images\testing, etc.
*.*;~test*.*;~\images\te*\ | Skip files named test.txt, testing.txt, etc and also
\*\images\*\i*.txt | A include mask only. This searches only i*.txt files in any subdir named \images any level below the search start path.
*.htm;~\*\_vti*\*\ | Uses wildcards to skip all the specialized Front Page subdirs in a Front Page web.


Print Function

Print Search Results

To send the Search Results to your printer, either:

  • Select "Print Search Results" from the Context Menu, Edit Menu , or toolbar to send a copy of the search results list to your printer. Depending on your computer setup, you will be presented with a standard Windows printer select dialog before the results are printed.

  • Go to Output Options and enter the phrase "Default Printer" (case insensitive, no quote characters) in the "Write Output to File" field. As with a dump to file (see above), the display settings under Output Options will be reflected in the printed output. Long lines will be wrapped. To turn off printing, return to Output Options, delete the string Default Printer from the "Write Output to File" field, and save the change by pressing the OK button.


HTML Output

View Search Results as HTML

Search and Replace can automatically generate an HTML version of the Search Results to an output file and launch your web browser to view this results file. The file is named "SrOut.htm". It is created in the same subdirectory as the Search and Replace program .exe (default is c:\tools\sr) and will be over-written with each new "View Results as HTML" operation. The information presented in the Search Results list is controlled by the settings in Output Options .

View Results as HTML is available from the Context Menu, Edit Menu, or the toolbar button.

Also see Options-Output. If you specify an 'htm' or 'html' name extension for the Output File the program writes that file in html format similar to 'View Results as HTML'.


Saving & Printing the Search Results List

Save (& Print) the Search Results List

There are several ways to save the Search Results to a file:

1. Highlight one or more lines in the Search Results and press Ctrl+C. This function is also available in the Context Menu and the Edit Menu. The clipboard contents can then be pasted into another editor.

2. The Search Results can be saved to a text file by specifying a path & file to write the results to in the "Write Output to File" field under Output Options . The display options specified under Output Options will be reflected in the output file, e.g., options such as whether filenames are included and the delimiters to use before &/or after search "hits."

3. You may also dump the Search Results to a printer by entering the phrase "Default Printer" (case insensitive, no quote characters) in the "Write Output to File" field. See Print Function for more information.

Notes:

  • The clipboard copy, data saved to a file, or output sent to the printer are in plain text form. If you need colored output please try HTML Output. See View Results as HTML for more information.

  • When one or lines from the Search Results List is copied to the clipboard the program also includes information about the Search/Replace strings, Mask/Path, and special settings in the clipboard material. If you have version 5.0+ you can modify this behavior using the "Copy Header Info" registry switch.


Actions Menu

The Search and Replace Actions Menu has the following items:

Search: Select this to start a search.

Search and Replace: Select this to start a search and replace. We recommend that if you use this feature you also enter a backup path in the Replace Options dialog.

Touch: Select this item to Touch the files found by your file mask(s), path, & filter options settings. You will be prompted for a date, time, and file attributes to use for all the files described by your settings. Using Touch from here affects all files that meet the above criteria. If you want to touch specific files, perform a search, highlight one or more files in the Search Results list, and use 'Touch Selected Files' on the context menu.

File Operations: Activates the File Operations dialog on the highlighted files.

Delete Files From Backup Path: Delete all files in the current backup path (Options|Replace). A prompt is offered but take care - Deletions are permanent!!

Exit: Select this to exit Search and Replace.


Edit Menu

The Search and Replace Edit Menu has the following items:

Copy Search Results: Select this to copy the Search Results (if any) to the clipboard. If the Search Results list contains nothing, this item is not available. Ctrl+C does the same thing.

Print Search Results List: Print the Search Results. Ctrl+P does the same thing.

Save Search Results: Select this to save the search results in a text file of your choice. Ctrl+S does the same thing. The program defaults to a file named 'Results'.txt' but you can change this if you want. The program also includes information about the Search/Replace, File Mask/Path, and special settings in the output. This behavior can be changed via a special see Registry Switch -- the Copy Header Info switch. Please note that the output is plain text. If you need output with coloring, try the HTML Output function.

View Results as HTML: Send the Search Results to an automatically generated HTML file and launch your default web browser.

Find In Search Results: Activates a find dialog to do simple searching in the search results list. F3 also launched the same dialog.

Swap Strings: Swap the Search For: and Replace With: strings. Ctrl+W does the same thing.


View Menu

The Search and Replace View Menu has the following items:

Open with Associated Viewer: This opens the current file in the Search Results (if any) using the associated viewer (program). If no viewer is associated with that file extension, the default viewer, configurable in General Options , is used (default is NOTEPAD.EXE). The file to open is determined by the focus in the Search Results list, which is marked by a thin rectangle or a highlight. If the Search Results list contains nothing, this item is not available. If the file is in a ZIP file, it is extracted to a subdirectory of the path specified in Search Options . If you edit a file that was in a ZIP, you must update the original ZIP file using your ZIP utility since ZIP files are NOT automatically updated. See Product Information for details about Directory Toolkit for Windows 95/NT, our multipurpose file and directory utility with built-in ZIP functions.

Open with Default Viewer: This opens the current file in the Search Results (if any) using the Search and Replace default viewer, configurable in General Options . NOTEPAD.EXE is used if no default viewer has been defined. The file to open is determined by the focus in the Search Results list, which is marked by a thin rectangle or a highlight. The Default Viewer menu item is not available if the Search Results list is empty. If the file is in a ZIP file, it is extracted to a subdirectory of the path specified in Search Options . If you edit a file contained in a ZIP you must update the original ZIP using your ZIP utility as ZIP files are NOT automatically updated.

The command line for the Search and Replace Default Viewer will pass the keywords, %line% and %path%, for the line number of the highlighted found string in the Search Results list and the complete path to the file containing that string. These keywords can be useful if your viewer supports command line switches to open a file at a specific line number. For example, if your viewer supports specification of a line number, you would make a setting under the "If no association use:" field in General Options of something like, "C:\Windows\SuperView.exe %path%(%line%)" (no quotes) to launch "SuperView" and move automatically to the line containing the string highlighted in the Search & Replace Results list. Consult the documentation for your viewer or editor for details on command line syntax. Note: If the filename itself is highlighted in the Search Results list, a value of 1 is passed for %line%.

Note: Search and Replace automatically quotes %path% when passing that data so do not supply your own quote characters. If your external editor has trouble parsing quoted file names, try adding quote characters around the entire command line string.

Open with...: This opens the current file in the Search Results (if any) using a viewer of your choice. A Select Viewer dialog allows you to select the viewer to use. The file to open is determined by the focus in the Search Results list, which is marked by a thin rectangle or a highlight. This item is not available if the Search Results list contains is empty. If the file is in a ZIP file, it is extracted to a subdirectory of the path specified in the Search Options tab. If you edit a file that was in a ZIP, you must update the original ZIP using your ZIP utility since ZIP files are NOT automatically updated. If you need a ZIP utility, please try our program, Directory Toolkit.

Context: Select this to view the current line in the Search Results (if any) and several lines before and after it using the Search and Replace internal context viewer. The file to open is determined by the focus in the Search Results list, which is marked by a thin rectangle or a highlight. This item is not available if the Search Results list is empty or if the focus on a filename line. Note that the Search and Replace context viewer displays text only. However, Search & Replace automatically detects binary files and launches our freeware application, HexView for Windows 95/NT, in order to view the context of binary files. See Product Information for details on HexView. Finally, note that if the results context is a file inside a ZIP file, it is extracted to a subdirectory of the path specified in Search Options . If you edit it, you must update the original ZIP using your ZIP utility since ZIP files are NOT automatically updated. See the View Context dialog for more information about viewing the context of search finds.

Note: When the focus (highlight) in the Search Results list is on a found string, double clicking with your mouse will also activate the context viewer. For the Win95/NT version of Search & Replace (SR32), the Enter key also activates the context viewer.

Explore From Here: Launches Window Explorer on the folder containing the higlighted file in the Search Results list. If no files are highlighted the folder containing the first search hit is opened. You can also launch from the context menu.

Expand All: Expand all entries in the Search Results List. The CTRL+Keypad + Key keyboard shortcut does the same thing.

Collapse All: Collapse all entries in the Search Results List.. The CTRL+Keypad 1 Key keyboard shortcut does the same thing.

Customize Toolbar: Select this to open the Customize Toolbar dialog.

Script: Select this item to display the Script Editor.

Options: Select this item to display the Options dialog.


Flags Menu

The items in the Flag Menu is used to enable/disable various parameters for your search/replace operation. These items are also selectable via their counterpart toolbar buttons.

Case Sensitive: Select this if you want the search to be case sensitive. Deselect if you want to search regardless of case.

Search Subdirectories: Select this to search all subdirectories of your path. Subdirectory searching will usually slow your search so turn it off if you only need to search the specified path. Note that if you are using a script and have options specified in your script, the Options section of the Advanced Tab in the script editor must be used to control subdirectory searching. The number of levels the program descends can also be controlled if you want.

Match Whole Word: When selected, Whole Word Mode, looks for the exact word or phrase specified, meaning, enclosed by whitespace (or a non-letter character). For example, if this option is on and you look for "Window", the program will find it in the phrase "...use the Window menu..." but not in the phrase "...Windows 95...". If this option is not checked, both occurrences will be found.

Regular Expression: Select this to use a Regular Expression. Case sensitive and binary mode may be used in conjunction with this type of search. When regular expression mode is enabled, Ignore Whitespace and HTML mode are not available. If Regular Expression is dim, make sure Ignore Whitespace and/or HTML mode are not enabled.

Search ZIP Files: Select this to search files inside ZIP files that exist in the specified path. When enabled, any PKZIP-compatible ZIP files present in the search path(s) will be examined and any files matching the file masks and filter options specified will be temporarily extracted to the extract path specified under Search Options and searched. This option may slow your searches, so you should turn it off if you do not need it. Note that it is not necessary to specify to *.zip on the file mask field to search ZIP files - simply select this field. Any file masks specified will be applied to files found inside of ZIP files. Note: Replacements are not made on files in ZIPs.

Ignore Whitespace: When selected, Ignore Whitespace allows Search and Replace to ignore extra spaces and \r (CR), \n (LF), \t (Tab) characters between whole words. This allows you to easily find, for example, the string "IMG SRC=" even if "IMG" and "SRC=" are on adjacent lines &/or separated by more than one space. Your search string must have one or more of the whitespace characters in the position where the whitespace exists in your file(s) for Ignore Whitespace to work. Note that replacements made with Ignore Whitespace ON do not replace the intervening extra spaces or \r \n \t characters. Therefore, to maintain these during a replace, use a Regular Expression search/replace. When Regular Expressions is turned on, Ignore Whitespace is not available.

HTML Mode: When selected, search and replace operations will automatically make ISO plain text character code substitutions. For example, when HTML Mode is enabled, a search for "Search & Replace" would find the string "Search &amp; Replace" in your html file. If a replacement is being made that involves a character for which there is an html special character code, the character code will be used. For example, if "x < y" is specified in a Replace field, "x &lt; y" is replaced in the document. You can visualize this in the replacement confirmation dialog by enabling replace confirmations (Options-Replace) or by enabling the display of replacement strings (Options-Output) and then performing a search. HTML Mode is not available when Regular Expressions are on. See HTML Mode for more information.


Favorites Menu

The Favorites Menu can be used to easily load scripts or search/replace string -& mask/path settings by selecting them from the list of entries.

To create a new entry:

1. Establish either your search/replace string -& mask/path settings or load an existing script via the Script Editor. If you load an existing script be sure to click on the "Use Script" button.

2. Select 'Add to Favorites' in the Favorites menu. Supply any name you wish.

To modify existing entries:

1. Select 'Organize Favorites' from the Favorites menu.

2. In the dialog (below) you can rename or delete entries. The Edit button will open the highlighted script in the Search and Replace Script Editor.

Notes:

  • Physically, Favorites are stored as scripts under the name specified. You can manually edit these if you like. Use caution if a Favorites script references a script located elsewhere.

  • The status of Case Sensitive , Subdirectory Search, Whole Word, Regular Expressions, Search Zips, and HTML Mode are saved with a Favorites script. Additional program options are not saved in the scripts.

  • The physical path used for Favorites can be adjusted from Options-General.

  • You can manually add script files to the physical \Favorites path but this usage is not supported. You must use the file name extension .srs or the program will not see your manually added script.

  • If you manually add a script file to the Favorites path and Search and Replace does not 'see' your addition in the Favorites list, select Organize Favorites in to refresh the list. Alternately, you can exit and restart the program to update the list.

  • The standard list is limited to 20 entries. If you have more than 20 in your collection, select the 'More Favorites' entry. This will open a 'Select Favorites' dialog that can then be used for selecting an entry from the entire list.

  • The sort order if the Favorites is alphabetical (ascending). The sort order currently cannot be changed. File names that begin with numbers come first so if you wish to 'force' a Favorite to be first in the list, use Windows Explorer or your file manger to rename the physical file so the name begins with '01 ' . Exit and restart Search and Replace or click on the Favorites - Organize button to update the list with your name change(s).


Favorites Menu - Select Favorites

Select Favorites

When more than 20 favorites are the Favorites list, a More Favorites choice is listed at the bottom (see bottom of left graphic). Select that to access the items that are off the screen.

Sample Long List of Favorites | More Favorites Selector


Options: Overview

Options Dialogs

Options are set from the View Menu or from the Options button on the main screen. Click on the graphic for help on the options categories.

Search & Replace Options


Options: General

General Options

Click on the graphic below for help on the options categories or scroll the screen down for a text description of the General options fields.

Details on General Options Fields:

Number of lines to view: Select the number of items to view before and after the search results hit line in the View Context dialog.

View Context Font Button: Click this to display the font dialog to select a new font for the View Context dialog.

If no association use: Enter the default viewer to use when: a) a file has no Windows file association on your computer or b) when you select the Search & Replace default viewer. You may also use the Browse button ( [image]) to select a default viewer via the Select Viewer dialog. Search and Replace can pass the following variables on the command line:

%path% - Full file path to the file

%line% - Line number of the search hit.

See External Editors for more information and some sample command lines. You can also configure the program to use the editor specified in this field instead of the internal context viewer.

Binary Editor: Enter the hex editor/viewer to use instead of the Search and Replace internal context viewer when a search hit is in a binary file. Search and Replace can pass the following variables to the command line:

%path% - full file path to the file

%start% - offset of first found character

%end% - offset of last found character

%length% - length of found string

See External Editors for more information and some sample command lines.

Favorites Path: Specify here the path to use for storing Favorites. You can change this to another path if network permissions will not be an issue for you. Check with your network administrator if you have questions about access permissions.

Double-click On Line Action: The four choices in the drop down list ( [image]) determine the response to a double click on a search hit line in the Search Results list. The choices are:

  • View Context (default): The Internal Context viewer is opened.

  • Open With Associated Viewer: The editor/view associated with the filetype according to your windows installation is used.

  • Open with Default Viewer: The editor/viewer specified in the If no association use field is used.

  • File Operations: The File Operations dialog is displayed.

Cache File List: Search and Replace normally caches the file names in the search path during the first file search. This saves time for paths that contain many files but may cause new files to be missed during subsequent searches in that same path. Unmark this box to have the program refresh the file list with each search/replace operation.

Single Instance Mode: When checked, only one instance of the program can be launched. When not checked, instances are identified:2, :3 etc in the window title so they can be distinguished in the Windows Task Bar and ALT-TAB switcher.

OK button: Saves the changes and closes the dialog.

Cancel button: The changes will not be made.


External Editors

Internal Context Viewer

By default the program uses an Internal Context Viewer to display the context of search hits when you double click on a hit line. As of v 4.6 the program can use the viewer/editor specified in the Text Files section below instead of the internal viewer. See External Context Viewer for more information.

Text Files

Search and Replace can launch a text viewer/editor of you choice on an item in the Search Results list via the 'Open with Default Viewer' function under the View Menu or the right click context menu.

The command line to launch the default viewer is configured in the 'If no association use' field in Options-General. The program defaults to using 'notepad.exe'. You can modify this to employ another program.

Two special switches are available: %line% and %path%. %line% will pass line number in the file where the search hit is found and %path% is the full path to the file highlighted in the search results list.

Consult the documentation for your viewer/editor for the command line switches that are understood by your program. It surely understands a file path for the file to open. However, not all programs have a command line switch for 'line to move to' upon opening a file.

Here are some settings for a few popular text editors.

1. TextPad (Helios Software, www.textpad.com):

C:\Program Files\TextPad 5\TextPad.exe %path%(%line%,1)

2. Multi-Edit v 8.0 (American Cybernetics, www.multiedit.com)

C:\Program Files\Multi-Edit8\MEW32.exe %path% /L%line%

3. UltraEdit (IDM Computer Solutions, www.ultraedit.com):

"C:\Program Files\UltraEdit\UEDIT32.EXE %path%/%line%"

Note: The UltraEdit command line may require surrounding " characters as modeled above. If your version of UltraEdit does not move the line highlighted in the Search Results List, try adding, or remove, surrounding "'s.

4. Notepad++ (Sourceforge.net - notepad-plus.sourceforge.net/uk/site.htm)

C:\Program Files\NotepadPlus\notepad++.exe -n%line% "%path%"

Binary Files

IMPORTANT: See Word Document Notes for critical information about replaces in binary files such as .doc, .xls, mdb, .gif, .pdf, .exe, etc.

Binary Search Results

If Search and Replace determines that the file being searched is a binary file the Search Results list switches to displaying 'offset' information as shown in the image below. If you have our freeware FSHED - Funduc Software Hex Editor installed on your computer, double clicking on a line in the Search Results will use FSHED to display the hit context.

You can configure the program to use a hex/viewer of your choice in the Options-General 'Binary Editor' field. Consult the documentation for your editor for the command line switches available for your program. Here are some example settings (lines will word wrap):

1. Hex Workshop (BreakPoint Software, www.bpsoft.com):

hworks32.exe "%path%" /GOTO:%start% /SELECT:%length%

Note: The /SELECT:%length% section can be removed if you don't want the selection found by Search and Replace to be highlighted when Hex Workshop launches. Remove /GOTO:%start% if you don't want Hex Workshop to jump automatically to the offset. You can add the switch /READONLY if you want.

2. FSHED - Funduc Software Hex Editor - a freeware hex editor we created. You can download a copy from the FSHED page on our web site.

fshed.exe "%path%" /s%start% /l%length%

3. HexView, an older hex viewer by Funduc Software:

hexview.exe "%path%" -S%start% -E%end%


Font dialog

Display fonts are set in General Options .

Font Field: The face name of the font used.

Font Style Field: The available styles vary depending on the Font selected. The most common are Regular, Italic and Bold.

Font Size Field: Point size of the font. You can enter a custom value if you don’t see it in the list for some fonts.

Strikeout box: Check it to select a strikeout font.

Underline box: Check it to select an underlined font.

Color list: Select the font color.

Script: Select the appropriate language script for that font.

OK button: The changes will be made.

Cancel button: The font will not be changed.


Color dialog

Display colors are set in General Options .

Basic Colors: Basic colors are a palette of the preset colors available for your display. Click the color you want to use or use the TAB key to move to the color you want and press the SPACE bar to select it.

Custom Colors: Custom colors may be set by using the Define Custom Colors Button. They are selected the same way Basic Colors are.

Define Custom Colors Button: Allow you to create your own colors.

OK button: The changes will be made.

Cancel button: The color will not be changed.


Options: Search

Search Options

Click on the graphic below for help on the options categories or scroll the screen down for a text description of the Search options fields.

Details on Search Options Fields:

Buffer Size: Buffer Size is the size (in bytes) of the memory block used by the program when reading files. The default is 102400. The lowest value permitted is 32768. In most cases you should leave this setting at the default. This setting is primarily used to speed up searching in combination with the Stop Processing After First Hit in File switch or the special registry switch - Num Buffers To Process. In most other cases setting this field to a lower or higher value will NOT result in faster searching. Low values may actually increase search time because the program will have to perform more separate file reads on a given file.

Maximum Regular Expression Size: Enter the maximum number of bytes to allow for regular expression searches . The maximum allowed is 32767 (32K) or 1/2 the size specified in the Buffer Size field. If you have many search & replaces involving simple expressions, smaller values may speed up operations. Conversely, if you have a regular expression search that involves Binary Characters and/or is very complex, larger values will be necessary.

Unzip files to: Enter a path (or use the browse button - [image]) to temporarily extract ZIP files to for searching when "Search ZIP files" is turned on (see Search and Replace Main Window). The default is the temporary directory defined by your computer's operating system, typically "Windows\Temp". Subdirectories will be created and removed as needed under the specified path.

Stop processing after first hit in file: For search-only operations, when this is checked the search will move on to the next file in the path, mask, & filter criteria after the first hit is found in a file. This is useful for quickly narrowing down files if you have a lot of data to search. For search & replace operations, when this field is checked and Replacement Confirmations are enabled, selecting the "Replace This" prompt will cause the search & replace operation to make that one replacement and then move to the next file. Selecting any other replacement prompt will cause all replacements to be made in that file before processing moves to the next file.

Display Maximum Characters: Enter a value to determine the maximum number of characters displayed on the first hit line in the Search Results list. The range is 128-4096 characters. Exit and restart for changes to take effect.

Sort Results By: Make a selection to use for the order files are listed in the Search Results list &/or Output File. Check the 'Ascending' box to use an ascending list. The choices in the [image] combo list are: Unsorted, File Name, File Extension, File Date/Time, File Size, and File Path. Unsorted means files are listed in the order they are found according to your file systems.

Show Progress Window: Enable this to display the progress meter.

Process Binary Files: By default, if File Mask or Filter setting do not limit searches otherwise, the program searches all files. To not search 'binary' files, uncheck this switch. When not checked, if the program determines a file is 'binary' it will not be searched. That file will still be listed in the Search Results but zero hits will be indicated.

OK button: Saves the changes and closes the dialog.

Cancel button: The changes will not be made.


Display Options

Click on the graphic below for help on the options categories or scroll the screen down for a text description of the Display options fields.

Number of items to save: Select the maximum number of items to save in the Search String, Replace String, Mask, and Path drop down combo list boxes ( [image]) next to the input fields on the main dialog.

Auto-Complete Combo Boxes: Check this to enable "fill-as-you-type" for the Search, Replace, File Mask, and Path fields in the main dialog. When enabled, if you type characters matching a string in the history list for that field the entry expands automatically.

Found Color Button: Choose this button to display the Color dialog, which you then use to select a new color for the found strings in the list.

File Color Button: Choose this button to display the Color dialog to select a new color for the file names where the strings were found.

Selected Hit: Activates a Color Dialog to change the color to use for the selected hit. Adjustments here can be helpful if you are working on a LCD display and the standard highlight color obscures color used the search hit.

Scroll Results: When enabled the Search Results List scrolls automatically as an operation is performed.

Quiet Mode: Silences all error messages. This is for advanced use only. Use this when you are very sure you do not need to see warnings about replacements in binary files or file locking reports. Enable this only if you are sure you need it! Remember, some error messages are useful! We suggest you use it for specific tasks and then return the program to normal mode when you are through with that task/project.

Show Results in a Tree: Enable this to activate the tree style in the Search Results list.

Collapse Results Branches: When enabled the initial search results tree appear in a collapsed state. You can expand it with the mouse or one of the keyboard shortcuts.

Copy Search Info to Clipboard: By default, if one or more lines are highlighted in the Search Results list and Ctrl+C is used to copy to the clipboard, the program includes information about the Search/Replace strings, Mask/Path, and special settings. Uncheck this switch to copy only the highlighted lines and not include details about search parameters. You may need to restart the program for changes to take effect. This switch has a similar impact on the material included in the output report (if enabled). See Options|Output.

Show Hits On Separate Lines: By default, each hit is shown on a separate line in the search results. When disabled, if there are multiple hits on a line the line is listed only once.


Options: Replacements

Replace Options

Click on the graphic below for help on the options categories or scroll the screen down for a text description of the Replace options fields.

Details on Replace Options Fields:

Backup File Path: Enter a backup path to use if you want Search and Replace to backup the originals of any files changed during a replace operation. You may use the Browse button ( [image]) to select a path via a Select Path dialog. If Search Subdirectories is turned on, the directory tree of the original path is created as necessary during the Replace operation.

Write Files to Backup Path: Check this box to write the files changed during a replace operation to the Backup Directory specified above. This will leave the original file(s) in the search path unchanged. If Search Subdirectories is checked, the directory tree of the search path is created as necessary under the path specified in Backup Directory. Note that if you check this, you need to remember that the newer, replaced versions of your file(s) will be in the Backup Directory. Search & Replace provides a reminder message when "Write Files to Backup Path" is checked.

Replace Prompts Group:

  • Select "Prompt On All" for prompts on every string to be replaced in every file.

  • Select "Prompt on Each File" for prompts for the total number of occurrences in each file. The Replacement Confirmation dialog is not presented for option.

  • Select "No Prompts" for no prompts whatsoever for all replaces. Note that If you use this option, you may not realize the exact context of every string you replace or which files you replace them in until after the operation is finished.

  • Note: If you are using an Advanced Script operation, read over the help section on Replacement Prompts for details about the behavior of replacement prompts and Advanced Scripts.

Replace Processing Group: Use this set of mutually exclusive radio choices to apply (or not) Special Case Handling during replacements. Please see Special Case Handling for more information and examples.

  • None: Standard mode. No special letter case changes made.

  • Capitalize All Words: The program capitalizes 'words' while making the replacement. For example, if the search string is coffee or tea and the replace string is bitter or sweet, the replace would be Bitter Or Sweet. This can be used with regular expression mode.

  • Match Capitalization: If the letter case of the existing text found is consistent within "words" the program will match the overall capitalization of the search hit and apply that while making the replace. For most searches this means if the first two alphabetic characters of the first 'word' is lower case, the replace will be lower case and visa versa. If the 1st is capital and the 2nd is lower, the replace case is 1st letter cap, remainder lower. If the search and replace strings differ in length, the pattern detected in the search will be continued forward replace string. This can be used with regular expression mode.

Do Not Change File Date/Time: When enabled, Search & Replace preserves the original time & date stamp of files when replacements are made.

OK button: Saves the changes and closes the dialog.

Cancel button: The changes will not be made.


Options: Output

Output Options

Click on the graphic below for help on the options categories or scroll the screen down for a text description of the Output options fields.

Details on Output Options Fields:

Hit Line Display: When checked -

  • Display Files Without Hits lists filenames where no occurrences of the search string were found. Note that if this is the only box checked, the display will not list files were the search string is present.

  • Display First Hit Line lists the filenames and the highlighted context of where the search string was found. If you are searching across multiple lines, the first line of the hit will be displayed. Note that if this is the only box checked, you will only get feedback from files where the search string was found.

  • Display Replace String lists the filenames, replacements, and total counts for all replacements. Note that if this is the only box checked, you will not see the context of each replacement. Check "Display First Hit Line" if you want to see the full replace contexts.

  • Display Number of Hits in File lists the filename(s) and number of times the search string was found in that file. Note that if "Display First Hit Line" is not checked, only the number of hits will be listed. Select this if you only want to know how many hits were found in each file.

  • Display File Size and Date/Time lists the size and date stamp of the files searched.

Show Output to File: To route the Search Results list to a file, enter a file in this field. If this field is blank, no file is produced. If no path is specified, the current directory is used. Use the Browse button ( [image]) to the right of the field to select an output file via a File Save As dialog. The default name suggestion is "Results.txt.". Supply another name if you want. The contents are the same as Note that what is written to this file is the same information presented in the Search & Replace results display. Therefore, to adjust the output, make selections in the "Hit Line Display" checkbox fields.

Notes and Additional Functions:

  • To dump the search results to the Windows clipboard, specify "clipboard" (no quotes) in this field. Clipboard contents are overwritten with each new search (or replace). To turn off the clipboard dump, blank out the field.

  • To route the search results to your printer, enter the phrase "Default Printer" (case insensitive, no quote characters) in this field. Long lines will be word wrapped in the printed output. To turn off printing, blank out the field.

  • To output the file contents in html format, specify '.htm' or '.html' as a name extension for the output file the program writes. The formatting is similar to the results you see from the 'View as HTML' function.

  • See the Copy Search Info to Clipboard switch in Options|Display to control whether or not search parameters are included in the output report.

Append to Output File: Enable this to write to the output file in 'append' mode. If the file exists, existing content is preserved. When this box is not checked, the output file is replaced each time.

Before Hit: Enter the string to use to demark the start of the search hit in clipboard dump or in the output file. Blank out this field if you want nothing to be displayed.

After Hit: Enter the string to use to demark the end of the search hit in clipboard dump or in the output file. Blank out this field if you want nothing to be displayed.

Text Line Prefix: This field can be used to modify the line prefix when Display First Hit Line is enabled. The default setting is Line %3ld -, which results in out such as Line 20 - , Line 12984 - , and so on. The syntax for changes somewhat complex. Please see Line Prefix Switches for details.

Binary Line Prefix: As above but controls the output when the file being searched is binary. The default string is Offset 0x%-6lx -. Please see Line Prefix Switches for details about making change to this setting.

OK button: Saves the changes and closes the dialog.

Cancel button: The changes will not be made.


Line Prefix Switches

Search and Replace v 4.8+ has two special settings in Options|Output to customize the line prefix strings in the search results list and the output file when Display First Hit Line is enabled. The two switches are described below. These settings can also be specified in the [Options] section of a script.

Note: Earlier versions of the program required a registry switch or use of the special configuration utility on the Search & Replace home page to change these settings. With v 4.8 can be used to specify these switches in Options|Output.

Line Prefix

To make a new special setting, use a printf style format:

[Literal text]%[flags][width]d[Literal text]

where

Literal Text - This can precede or follow the number component.

% - This character is required.

flags - This can be space or 0. This determines padding character to use, if any if the width of the line number returned is less than width. Space padding to the left is assumed.

width - This is the minimum width to use. If you specify a number that is larger than the line number returned by Search and Replace, it is padded with space or 0, depending on above.

d - this is required. It must follow the width specification.

Line Prefix Examples:

Line %3d - This sample is actually the default form if nothing is specified. For example:
Line 81 - <http>://www.funduc.com
Line 82 - <http>://www.searchandr

%05d: This pads with 0, 5 wide, followed by : character. For example:
Line 00081: <http>://www.funduc.com
Line 00082: <http>://www.searchandr

Binary Line Prefix

This is similar to the Line Prefix setting above but controls the line prefix when the hit is in a binary file. The choices are similar to the Line Prefix setting above except you must specify should specify lx (lower case L, lower case X) for type. We suggest you preface the 0x for a literal but this is not required.

Binary Line Prefix Examples:

Offset 0x%6lx - This sample the default form if nothing is specified. For example:
Offset 0x155 - ô<H>
Offset 0x241 - <h>M

0x%05lx: This pads with 0, 5 wide, followed by : character. For example:
0x00155: ô<H>
0x00241: <h>M


Options: Filters

Filter Options

Click on the graphic below for help on the options categories or scroll the screen down for a text description of the Filter options fields.

Note: Use the Complex File Mask dialog to 'filter' files by file name or path.

Details on Filter Options Fields:

Exclude File(s) by Date: When 'Reverse Filters' is disabled, the 'Before Date' setting excludes all files whose date stamp precedes the date entered and the 'After Date' excludes files whose date stamp falls after the date entered. Enabling 'Reverse Filters' causes the settings to function in the opposite fashion - an 'include only' setting. You may enter values in one or both date fields. By combining settings, you can limit operations to files whose time stamp falls in a specific range. For example, to process only files that were last modified in November 2010, enter a "Before Date" of 10/30/2010and an "After Date" of 12/01/2010. Date exclusions can also be combined with one or both of the exclude by size filters. See Size and Date Filter Examples for more examples.

You can also enter the special token - %%today%%. This code is intended for manually edited scripts and not the GUI, but it does work. The program converts the entry to either the current date or the value calculated. For example, if you enter %%today-10%% and the current date is March 17, 2010, the program will convert this to March 27, 2010.

Exclude File(s) by Size: When 'Reverse Filters' is disabled, the 'Less Than' field excludes all files whose size is smaller than the value entered and the 'Greater Than' setting excludes files whose size is larger than the value specified. Enabling 'Reverse Filters' causes the settings to function in the opposite fashion - an 'include only' setting. Size units may take the form of number of bytes or whole K, KB, or M values, e.g., 100K, 100KB, 1M, 4M. Do not specify fractional values when using K, KB, M quantities. You may enter values in one or both size fields and size exclusions may be combined with one or both date exclusion values. See Size and Date Filter Examples for some samples.

Attributes: Select one (or more) attribute-types to exclude from your operation.

>>> See Filters - Attribute Examples for some sample settings.<<<

Dim: The attribute is not considered in any filter.

Checked: Files that do not have the checked attributes will be included. For example, to do an operation on files that do not have archive set, check 'Archive'. To list files that are not 'ah', check 'Archive' and 'Hidden'. The checked attributes are 'ANDed', meaning all the checked attributes must be present. For example, when 'Archive' and 'Hidden' are checked, 'a', 'h', 'ar', 'as' are listed but 'ahr' or 'ah' are not.

Unchecked: Files having that attribute in combination with any other unchecked attribute are included. For example, to include 'a' and 'ro', uncheck 'Archive' and 'Read Only'.

Combinations of Checked and UnChecked: Checked and unchecked creates an 'OR' relationship between the checked and unchecked items. For example, 'Archive' unchecked and 'Read Only' checked eliminates 'r' from the operation that are either 'r' alone or do not have 'a' involved as well. This means that 'rsa' files would be included but not 'rh' files. To continue, if 'Archive' is unchecked and both 'Read Only' & 'Hidden' are checked, files that are both 'rh' are eliminated except for files that also include 'a'.

Notes:

  • Attributes have many possible choices and combinations of checked/unchecked can be confusing. A 'dim' check in all attributes fields and Reverse Filters off (unchecked) is the program default. If you need to return to baseline, make your settings appear like they do in the graphic here.

  • When Reverse Filters is disabled checked choices originate from the perspective of an 'exclude' filter. For example, if 'System' alone is checked, all 's' files are excluded. If 'System' and 'Read Only' are checked, files that are 'sr' in some way are excluded.

  • If you need to 'filter' files by file name or path, use the Complex File Mask dialog.

Reverse Filters: Reverse Filters is used to make the Minimum & Maximum Size, Minimum & Maximum Date, and File Attribute settings work as 'inclusive' filters. Dim vs. Checked vs. Unchecked for Attribute choices work in a similar fashion to when Reverse Filter is off except that logic works toward including files instead of ruling them out.

For example, Reverse Filter = On, 'Archive' & 'System' checked includes files that are 'as' in some way. If Reverse Filter = Off, no 'as' files are listed.

To continue, Reverse Filter = On, Minimum Date=11/01/2010, Maximum Date Filter=11/30/2010, and 'Archive' is checked, 'a' files 10/31/2010or earlier AND those 12/1/2010or later will be included.

Reset Button: Click this turn off all filter settings by resetting the fields back to the defaults.


Filters - Size and Date Filter Examples

Below are some sample outputs showing the effect of date and size filters and the Reverse Filter switch in Options-Filters on which files would be searched. Note the effect of enabling Reverse Filters, which causes the date and size settings to act as 'include' settings instead of 'exclude' settings. Also note the last example, which shows the use of two size settings to eliminate the smaller and larger files, leaving only the 'Middle.txt' file If more files were present you could also specify one or both of the date filters to list only files between 100 and 2000 bytes that were created between Jan 01, 2003 and Dec 31,2004, for example.

Also see Attribute Filter Examples for information on how the attribute switches in Options-Filters can be used.

Note: Use the Complex File Mask dialog to 'filter' files by file name or path.

No Filters Specified:

File Name | Size | Modified Date
OldSmall.txt | 10 | 04/22/04
OldLarge.txt | 9600 | 04/22/04
Middle.txt | 1000 | 05/01/04
NewerSmall.txt | 10 | 10/22/04
NewerLarge.txt | 9600 | 10/22/04

Before Date = 04/01/04, Reverse Filters = Off:

File Name | Size | Modified Date
NewerSmall.txt | 10 | 10/22/04
NewerLarge.txt | 9600 | 10/22/04
Middle.txt | 1000 | 05/01/04

Before Date = 04/01/02, Reverse Filters = On:

File Name | Size | Modified Date
OldSmall.txt | 10 | 04/22/04
OldLarge.txt | 9600 | 04/22/04

Less Than Size = 100, Reverse Filter = Off:

File Name | Size | Modified Date
OldLarge.txt | 9600 | 04/22/04
Middle.txt | 1000 | 05/01/04
NewerLarge.txt | 9600 | 10/22/04

Less Than Size = 100, Reverse Filter = On:

File Name | Size | Modified Date
OldSmall.txt | 10 | 04/22/04
NewerSmall.txt | 10 | 10/22/04

Less Than Size = 100, Greater Than Size = 2000, Reverse Filter = Off:

File Name | Size | Modified Date
Middle.txt | 1000 | 05/01/04


Filters - Attribute Filter Examples

Below are some example filter settings using the Attributes & Reverse Filters checkboxes in Options-Filters.

Notes:

  • To return to baseline, make your settings 'Dim', Reverse Filters = Off (unchecked).

  • When Reverse Filters is off, checked choices originate from the perspective of an 'exclude' filter.

  • If you need to 'filter' files by file name or path, use the Complex File Mask dialog.

Goal | Settings
Process 'a-only' files | Reverse Filter = On, Check 'Archive', Uncheck everything else. Make 'Directory' dim to also list 'a' subdirs.
Process files with no attribute set | Reverse Filter = On, Uncheck everything else. Make 'Directory' dim to also list subirs with no attribute set.
Process files that are 'ra' in some way | Reverse Filter = On, Check 'Read Only' and 'Archive', Others dim.
Process files that are not 'r' in some way | Reverse Filter = Off, Check 'Read Only', Others dim.
Process files that are not 'ah' in some way | Reverse Filter = Off, Check 'Archive' and 'Hidden'.


Keyboard Shortcuts

Some general keyboard shortcuts are available in the Search and Replace Main Window.

Aborting Current Action
ESC | Abort a Search. CTRL+ Mouse Click the Search button does the same thing.
Search and Replace Actions
CTRL+F | Search
CTRL+H | Search/Replace
CTRL+ALT+F | Search only the files currently listed in the search results.
CTRL+ALT+H | Search/Replace only the files currently listed in the search results.
SHIFT+CTRL+H | Search-Replace Windows Clipboard
Search Results List
F2 | Launch the File Operations dialog. If one or more highlighted files in the Search Results are selected, those files are added to File Operations. If no files are select, all the files in the Search Results are used.
F3 | Find in Search Results (focus must be in the Search Results List)
CTRL+C | Copy current Search Results to the clipboard OR copy the current highlighted line in the Search Results. You may need to refresh the search if you want the entire contents copied. Clipboard copy is also available from the Context Menu.
CTRL+Keypad + Key CTRL+Keypad - Key | Expand / collapse all search hits in the Search Results list. This can also be done in the View Menu.
Spacebar on File Names | Expand/Collapse search hits for that file in the Search Results list.
F4/F5 | Move the focus Down/Up file names in the Search Results list.
CTRL+S | Save the current search results to a file of your choice.
Others
CTRL+W | Swap the Search For: and Replace With: strings in the main window.
CTRL+Mouse Click the Binary Mode Button | To insert the current search / replace strings into the respective binary mode dialogs, hold the CTRL key as you click on the [image] button to the right of the field.
CTRL+Mouse Click the Script Button | Dump current program settings & strings to a script file named 'srdump.srs' in the same path as sr32.exe.
CTRL+Remove All Button | Script Search/Replace & Path/Mask Dialogs Only. Removes all current entries in the script and inserts the counterpart search/replace strings or mask/path entries from the main dialog into the script. Be sure to click on the Add button to commit your entry.
CTRL+Insert Button | Script Search/Replace & Path/Mask Dialogs Only. Inserts the search/replace string and mask/path entries from the main window into the script. Be sure to click on the Add button to commit your entry.
CTRL+PgUp/PgDown | In the View Context dialog - jump to previous/next search hit.
Shift+DEL | In the Search for: and Replace with: fields in the main dialog. Deletes the current entry.


Find Files

To use Search and Replace to locate files:

1. Enter one or more file masks and a path in the main dialog.

2. Do not enter a Search String (blank out the existing Search String).

3. Click on the Search button.

Files in the search path that match the file mask criteria will be displayed in the Search Results List.

Note: To do a file find from the command line, specify /s but use no search string. For example,
sr32 /s /d /pd:\test\*.htm
will locate all *.htm files in d:\test.


Clipboard Search Replace

Search and Replace can do search/replace on the contents of the Windows Clipboard.

To do this:

1. Copy the text you are interested in to the Windows Clipboard using your routine method such as CTRL+C.

2. Switch to Search and Replace and establish the Search for: &/or Replace with: strings. You can also load a script or Favorites entry. Regular Expressions and any of the other settings such as Case Sensitive, Match Whole Word, etc. can be activated. The File Mask & Path fields can be anything - these are not used for Clipboard Search-Replace.

3. Press SHIFT+CTRL+H simultaneously.

4. If a search hit is found and if you have replacement confirmations enabled, Search and Replace will prompt you to make a replacement in a temporary file in your Windows Temp path. Permit the program do so (if you want the replace to happen)

5. Switch back to your other application where you will make use of the changed clipboard contents and paste it in using your routine method such as CTRL+V.


Find In Search Results

You can search the Search Results list for a simple string by pressing F3 when the focus is in the Search Results list or by selecting "Find in Search Results" from the context menu. The search string can differ from the search string used to generate the results list.


Search Replace Current Files

Search and Replace can limit follow-up search &/or replace operations to only the files currently listed in the Search Results section of the main window. This is useful for narrowing down your operation or possibly saving you from having to change your path &/or file mask. For example, you could search a path for all the files containing the word "Windows" and then use the feature here to do a replace to change W2K -> Windows 2000 only in those files.

To use this feature, first perform your initial search. Next, change your search &/or replace strings. Finally, use one of the two special keyboard shortcuts to do either a search or a search/replace.

The shortcuts are:

CTRL+ALT+F | Search only the files currently listed in the search results.
CTRL+ALT+H | Search/Replace only the files currently listed in the search results.


Find Menu Feature

Windows Find Menu

The standard installation of Search and Replace lists the program in the Find section of the Windows Start Menu. The menu item will launch a Search & Replace session using the last settings for the program.

Find Menu Example


Explore From Here

You can launch Windows Explorer on the path (folder) that contains a file in the Search Results list by highlighting that file and selecting Explore From Here from the View Menu or the context menu.


Touch Files Dialog

"Touch" allows you to change the time & date stamp and file attributes for the files found by the file mask, path, and filter settings. To use the Touch dialog: a) Enter (or select from combo boxes) one or more file masks and a path, b) Verify your filter options settings for excluding files by file date &/or file size, c) Select "Touch" from the Actions Menu or the Touch button, d) Make your settings in the Touch dialog, e) Click on the OK button to implement your choices.

Touch is also available from the Command Line.

Click on the graphic below for help on the fields or scroll the screen down for a text description of the Touch dialog fields.

Important Note: When Touch is activated from the Actions Menu or the Touch toolbar button it operates on all files described by the file mask, path, and filter criteria. If you want to touch specific files, perform a search, highlight one or more files in the Search Results list, and use 'Touch Selected Files' on the context menu.

Details on the Touch Dialog fields:

Set Files' Date/Time Only: Mark this field if you only want to change the time & date stamp for the files. This field is mutually exclusive with the "Set Files' Attributes Only" and the "Set Date/Time and Attributes" fields.

Also Set Creation Date: Mark this field to also change the Creation date. This field is dim and not available in the Win3x version.

Also Set Access Date: Mark this field to also change the Last Access date. This field is dim and not available in the Win3x version.

Date Field: Enter the date to be used. The date format follows the regional settings for your computer so make your entry in the form as it appears in the field. 00 or 2000 may be used for the year 2000 and above.

Time Fields: Enter the time to be used using a format that corresponds to the Regional Settings for your computer.

Add to File Time: This function adds (or subtracts) the specified number of seconds to the current time stamp for the file(s). To subtract seconds, enter a negative value. For example, to roll back the current time stamp by one hour, enter a value of 3600. The files date will also be adjusted +/- if your "Add to File Time" value causes the new file time cross midnight. If "Also Set Creation Date" &/or "Also Set Access Date" are checked, these values will also be adjusted.

Set Files' Attributes Only: Mark this field if you only want to change the attributes for the files. This field is mutually exclusive with the "Set Files' Date/Time Only" and the "Set Date/Time and Attributes" fields.

Attributes: Mark some or all of the fields. The checkboxes have three choices -- marked, unmarked, and a dim mark. The dim-check choice is used if you want to leave the existing attribute setting for that field unchanged. For example, in the graphic above, the Read Only field is a dim mark. This means that files already having a Read Only attribute setting will remain so. Conversely, those not already set as Read Only will not be set to Read Only. The solid mark in the Archive field means that all files will be set to Archive. The unmarked settings for Hidden & System means that Hidden &/or System attributes, if present for any files, would be removed.

Set Date/Time and Attributes: Mark this field if you want to change both the time/date stamp and the file attributes. This field is mutually exclusive with the "Set Files' Date/Time Only" and the "Set Files' Attributes Only" fields.

OK Button: The dates and times &/or attributes will be set for all the files described by the file mask, path, and filter criteria.

Cancel Button: No files will be touched.

Update Button: The date and time fields will be refreshed using the current date and time according to the PC's clock.

Help Button: Launch program help.


Customize Toolbar

Click on the graphic below for help on customizing the toolbar. You can launch the Customize Toolbar dialog from the View Menu or by right clicking in the main dialog anywhere in the toolbar button area.


About ZIP Functions

ZIP File Information

ZIP files, or ZIP archives, are files that contain one or more other files that are stored inside of the ZIP. The files inside of ZIP files are typically stored in a compressed form that reduces the size of the original file(s) to save on amount of disk space needed. Search and Replace is able to search through ZIP files created using the PKZIP standard.

Important Note:

ZIP functionality is only available for Searches. To do replacements on files inside of ZIP files, extract the files to a temporary path using a ZIP utility such as our Directory Toolkit and then re-archive when you are finished. Also note that while you may use the context viewer on search results in ZIPs, edits you make via the context viewer will not be saved back to the original ZIP.

To enable ZIP searches, click on the 'Search ZIPs' button or use the Flags Menu. When enabled, all ZIP files created with PKZIP or compatible utilities present in the search path(s) will be examined and any files meeting file mask and filter criteria are temporarily extracted to the extract path specified under Search Options and searched.

Additional Notes:

  • Do not specify '*.zip' in the file mask field to search ZIP files. Enabling ZIP search mode automatically searches files ending with the .zip file name extension will be searched. The file mask does apply to files inside the .zip. For example, if your mask is *.txt, only .txt files in your zip(s) will be searched.

  • Searching ZIP files requires extra processing and may slow down your search so you may wish to turn if off when you do not need it.

  • Search and Replace does not search "password" encrypted files in ZIP files, e.g., files stored with the PKZIP -s switch.


Progress Meter

A progress meter is displayed as Search and Replace processes your files.

A progress meter is not displayed when the program is launched from the command line in 'Minimized mode'.

You can disable the progress meter during interactive use from Options-General.

Please be patient when operating on very large files. Many factors can affect program speed: The complexity of your operation; The size of the files involved; Network speed; Available memory on your machine; Processor speed; Other tasks running on your machine.

Tips to speed up performance on large files include:

  • Disable 'Display First Hit Line' in Options-Output. If you need a listing of search results, using an output file.

  • When using scripts, several smaller scripts with fewer steps per script may be faster than one very large script.

  • Use Complex File Masks or Filters to narrow your list of files to search if you know some files can be ruled out.

  • If network speed is an issue, copy the files to a local path to perform your operation.


Display Font

The Context Viewer font can be set via the Options|General "View Context Font" button. A special setting is available in version 4.2+ to set the font & size to use for the overall program. This setting can be made manually via one of the special registry settings or via the special configuration utility on our www site. Please visit the Search & Replace home page for a link to the "SR Special Configuration Utility".


Registry Switches

Special Registry Switches

Search and Replace has several special registry switches that are available for advanced usage.

Visit the Search & Replace home page for a link to an easy to use special configuration utility that can be used to specify some of the below switches and also reset all the program settings.

Warning: We present this information for the benefit of advanced users. Do not modify your windows registry if you are not familiar with the risks involved. A careless change to may cause your computer to stop functioning and require that you reinstall your operating system and all applications. If you are not familiar with working with the registry directly, use the configuration utility above.

See our Registry Toolkit utility for a registry search/replace tool or write support@funduc.com.

In case do need to do so, all keys under
[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32]
can be removed manually (exit the program first). Whenever all or some of those keys are missing at launch time, Search and Replace will recreate them with the program default values. You will only have to restore keys you manually added or changed.

Special Registry Switches for Search and Replace V 5.7+

REGEDIT4

# The registry switches below are read by Search and Replace to

# control some special features. Some switches do not have a

# counterpart in the graphical interface Options dialogs and must

# be set manually. Use the information here to make these settings.

# These settings are intended for advanced users. You assume all

# responsibility for making the registry changes carefully.

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** DISABLE REPLACE CAPABILITY ***

# Use this switch to deactivate replace ability. Specify

# No Replace"=dword:00000001 to disable replacing.

"No Replace"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** MULTIPLE SEARCH HITS ON ONE LINE ***

# For v 5.6+. When Show Hits on one line is enabled, if

# a search term has more than one hit on a line that line

# is listed only once in the Search Results List. The standard

# behavior is to list each hit separately in the Search Results List.

# It is recommended you use this function only if you need it.

# To enable, specify "Show Hits on one line"=dword:00000001

"Show Hits on one line"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** SEQUENCE REGULAR EXPRESSION COUNTERS OR NOT ***

# This is for version 4.1+. The program normally sequences

# regular expression counter replacements across files when

# a starting value is specified. If the below setting is

# changed to "Count across files"=dword:00000000 the program

# will started counting anew with each file instead of counting

# across all files.

"Count across files"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** MAXIMUM CHARACTERS TO DISPLAY ***

# This is normally set in Options-Search. That dialog has limit

# checks on the value input by the user. You can set this directly

# via the below registry switch. For example, to see more than 512

# characters on a line uncomment line below for 1024 per line and

# remove the one after.

#"Max Display Chars"=dword:00000400

"Max Display Chars"=dword:00000200

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** COPY SEARCH RESULTS HEADER INFORMATION ***

# Note: In v 5.2 this setting can be made in Options|Display.

# By default, if one or more lines are highlighted in the Search

# Results list and Ctrl+C is used to copy to the clipboard, the

# program includes information about the Search/Replace strings,

# Mask/Path, and special settings. In version 5.0+, to not include

# the extra information, specify "Copy Header Info"=dword:00000000.

# This switch has a similar impact on the material included in the

# output report (if enabled). See Options|Output.

"Copy Header Info"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** PRIVACY FUNCTIONS - CLEAR HISTORY ****

# For version 5.1+. To cause the program to clear one or more of

# the history lists, exit Search and Replace if it is running and

# make the setting described here. The next time you exit the

# program those items will be purged.

#

# To clear just one history list, specify only that dword value. To

# clear several, add their values together (decimal math) and

# specify that as a dword. dword values are saved as hex but the

# Windows Registry Editor lets you specify decimal values.

#

# Function Value

# ---------------------- -----

# Clear Search History 01

# Clear Replace History 02

# Clear Paths 04

# Clear Masks 08

#

# Some Example settings:

# Search History - "Clear Flags"=dword:00000001

# Replace History - "Clear Flags"=dword:00000002

# Search & Replace - "Clear Flags"=dword:00000003

# Path - "Clear Flags"=dword:00000004

# Mask - "Clear Flags"=dword:00000008

# Path & Mask - "Clear Flags"=dword:0000000c

# Search & Path - "Clear Flags"=dword:00000005

# Search & Mask - "Clear Flags"=dword:00000009

# Search, Replace, Path - "Clear Flags"=dword:00000007

# Search, Replace, Mask - "Clear Flags"=dword:0000000b

# Replace & Path - "Clear Flags"=dword:00000006

# Replace, Path, Mask - "Clear Flags"=dword:0000000e

# All items - "Clear Flags"=dword:0000000f

"Clear Flags"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** PROCESS BINARY FILES ***

# Note: In ver 5.1+ this switch can be set in Options|Search.

# By default, Search and Replace searches any file. In version 5.0+

# a switch is available to skip files that the program determines

# are 'binary'. When "Process Binary Files"=dword:00000000 is

# specified the program will skip binary files regardless of the

# File Mask specified. The file(s) will still be listed in the

# Search Results but they will be reported as having zero hit. This

# switch can also be specified in a script.

"Process Binary Files"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** XML NAME EXTENSIONS ****

# By default the program automatically handles UTF-8 .xml files.

# The XML Extensions= switch can be used to add other file name

# extensions to handle as .xml. Multiple extensions should be

# separated by the ; character. Use lower case. Do not use the

# * character. For example, XML Extensions=.xml;.sml

"XML Extensions="=".xml"

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** ZIP FILE NAME EXTENSIONS ****

# The ZIP Mask= switch determines the file extensions the program

# will process as ZIP format archives when search ZIPs is enabled.

# The default is *.zip. JAR searching can also be enabled by

# specifying "ZIP Mask"="*.zip;*.jar". Please note that only PKZip

# format archives can be searched.

"ZIP Mask"="*.zip"

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** FILE MASK WITHIN ZIPs ****

# To process some specific file masks within ZIPs, make a setting

# for the "ZIP File Mask"="" switch. This is normally not specified.

# When not specified, the File Mask setting for the program itself

# is used. Please take care if you do specify a "ZIP File Mask"= as

# this overrides the general File Mask setting.

"ZIP File Mask"=""

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** DISABLE WARNINGS DURING INTERACTIVE USE ****

# In version 4.9+ this switch can be specified in Options|Display.

# To disable various warnings and message boxes during interactive use,

# specify "Quiet Mode"=dword:00000001. The /u switch does the same

# thing if you are using the command line switches. You can also set

# this switch in Options|Display.

"Quiet Mode"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** RAISED VS FLAT TOOLBAR BUTTONS ***

# If you want raised toolbar buttons, change the "Flat Toolbar"=

# switch to "Flat Toolbar"=dword:00000000. The default is a

# flat toolbar.

"Flat Toolbar"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** PREVENT MULTIPLE PROGRAM INSTANCES ***

# In version 5.3+ this can be set in Options|General.

# Search and Replace normally permits multiple instances of the program

# to be launched. If you only want one instance of the program to

# be possible, specify "One Instance"=dword:00000001

# Please note that enabling 'One Instance' may affect the behavior of

# the Explorer shell extension -- the program does not inherit the

# highlighted file name(s) when 'one instance' is enabled.

"One Instance"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** BINARY EDITOR TO USE ****

# In version 4.9+ this can be set in Options|General.

# To be used if you wish to use a binary editor for binary files

# Uncomment line below and change as needed using keywords below

# and also %LENGTH% for the length of the selection if needed.

"Binary Editor"="HEXVIEW \"%path%\" -S%start% -E%end%"

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** DISABLE PROGRESS METER ***

# In version 3.7+ you can control this in Options-General. For

# version 3.6 specify "Show Progress Dialog"=dword:00000000 to

# deactivate the progress dialog.

"Show Progress Dialog"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** DISABLE AUTOMATIC SCROLLING OF SEARCH RESULTS ***

# In version 3.7+ you can control this in Options-General. For

# version 3.6 specify "Scroll Results"=dword:00000000

"Scroll Results"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** DISPLAY & OUTPUT PREFIXES ****

# In version 4.8+ these settings can be made in the Options-Output.

# For v 4.3 - 4.7 the switches below can be used to customize the

# line prefixes for text and binary files. The numbering is in MS

# printf style formatting -- d and l are supported. Anything before

# the % char and after d or l are output as literal text. The data

# cannot be blank or there will be problems opening files in the

# viewer on the correct line. Also, if you leave out all numbers

# there may be problems viewing the files. If you do not want the

# switches, rename the values to something else or take them out

# completely. Below are the default settings:

# "Line Prefix"="%2d: "

# "Binary Prefix"="0x%-6lx: "

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** SPECIAL REPLACEMENT CASE HANDLING ***

# In version 4.9+ these settings can be set in Options|Replace.

# For v 4.4 - 4.8+, this switch is used for special capitalization

# handling during replacements. Please see the F1 Help topic

# 'Special Case Handling' for more information.

# The possible values are:

# "Replace Processing"=dword:00000000 - Default, No special

# effects.

# "Replace Processing"=dword:00000001 - Capitalize words

# during replaces.

# "Replace Processing"=dword:00000002 - Match existing letter

# letter case.

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** BUFFER SIZE ***

# Note: In v 5.2+ this setting can be specified in Options|Search.

# The size of the memory block used by the program when reading

# files can be adjusted. For most uses we suggest leaving this at

# default, with is "Buffer Size"=dword:00019000 (102,400 bytes

# decimal). If nothing is specified the default is assumed.

# The lowest value permitted is dword:00000400 (1024 bytes decimal).

# Note: Buffer Size may have indirect effect on Maximum Regular

# Expression Size (Options|Search). When Buffer Size is set lower

# than Maximum Regular Expression Size, by limiting the size of

# block(s) searched the effective Max Regular Expression Size is

# limited to Buffer Size. The default Max Regular Expression Size

# is 32767 bytes. If your search requires this span as a minimum,

# Buffer Size should be at least "Buffer Size"=dword:00007FFF

# (32767 decimal).

# Exit Search and Replace before making changes to this setting.

"Buffer Size"=dword:00019000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Flags]

# *** NUMBER OF BUFFERS TO PROCESS ***

# IMPORTANT: This switch is for Search only. During replace the

# program must process the entire file(s)!

# You can limit the number of blocks to process in each file by

# specifying the number of blocks to process. The default if

# nothing is specified is "Num Buffers To Process"=dword:00000000,

# which is all blocks, or the entire file. This switch can be

# used in conjunction with the "Buffer Size" switch above. For

# example, to search only the first 26,000 bytes of all files

# specify:

# "Buffer Size"=dword:00006590

# "Num Buffers To Process"=dword:00000001

# Note: If the 'Stop Processing After One Hit' switch is specified

# in Options|Search, that switch takes precedence if a hit is found

# within the number of blocks specified.

# Exit Search and Replace before making changes to this setting.

"Num Buffers To Process"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Settings]

# *** DISABLE CHECKBOXES IN SCRIPT EDITOR ***

# This is for version 4.1+. When the below is set to

# "Script Checkboxes"=dword:00000000 the program will not display

# the checkboxes for individual search/replace items in a script.

# If not specified, script checkboxes will be displayed.

"Script Checkboxes"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Settings]

# *** SPECIAL DIALOG FONT SWITCHES ***

# In version 4.2+, the switches below are used to change

# the font face and size used for the main dialog and script

# editor. Currently there is no GUI choice in program Options

# to specify these settings so they must be done manually.

# A special utility is available on our www site to set these.

# Go to the Search and Replace product page and follow the link

# to the 'Special Configuration Utility'.

#

# Here are some notes if you want to make the change manually.

#

# - Dialog Font - The name used for the Dialog Font is the name

# returned by the operating system for your font list. Do not use

# the font name you see in Explorer if you navigate to the \Fonts

# folder. Instead go to the Search and Replace Options|General

# tab and examine the View Context Font setting. Use the 'Font'

# selector to see the list of font names. Make a note of the name

# you want and then Cancel the dialog so you don't change your

# View Context settings. Then use that same font name string for

# the Dialog Font switch below.

#

# - Dialog Font Size is a dword value. Do not specify a decimal

# value! Here are some common dword settings:

# 8 pt - Dialog Font Size=dword:00000008

# 9 pt - Dialog Font Size=dword:00000009

# 10 pt - Dialog Font Size=dword:0000000a

# 11 pt - Dialog Font Size=dword:0000000b

# 12 pt - Dialog Font Size=dword:0000000c

# 14 pt - Dialog Font Size=dword:0000000e

# "Dialog Font Size"=dword:00000008

# "Dialog Font"="Trebuchet MS"

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Settings]

# *** LIMIT SUBDIR RECURSE LEVELS ***

# For v 4.6+, the switch below can be used to limit how many

# subdirectory levels the program will recurse when Search

# Subdirectories is enabled. A value of dword 0 means there is

# no limit. This switch does not control whether Search

# Subdirectories is active or not. Use the Search Subdirectories

# switch in the main dialog or your script to control subdir

# searching in general.

# "Directory Depth"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Options]

# *** FILE NAME SORT IN SEARCH RESULTS LIST ***

# This is controlled in Options-Search.

# "Sort File Names"= 1 is Name, 2 is type(extension), 3 is date

# 4 is size, 5 is path.

"Sort File Names"=dword:00000001

"Sort Ascending"=dword:00000001

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Options]

# *** FILE OPERATIONS DIALOG ***

# Specify the default target path for File Operations dialog using

# this switch:

# "File Operations Path"="d:\\temp"

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Options]

# *** CUSTOMIZE VIEW CONTEXT DISPLAY SPACES FOR TAB CHARS ***

# Use this switch to control the number of spaces to expand tab

# characters in the internal context viewer. 00000004 is the

# program default.

"View Context Tabs to Spaces"=dword:00000004

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Options]

# *** DISPLAY FILE DATE AND TIME ***

# This switch is controlled in Options|Output.

# The Show File Date and Size= switch displays this information

# in the Search Results list. Note that this info may not be

# accessible to F3, 'Search in Search Results list' function.

# The values are:

# "Show File Date and Size"=dword:00000001

"Show File Date and Size"=dword:00000000

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\Options]

# *** DISABLE INTERNAL CONTEXT VIEWER ***

# In version 4.9+ this setting (and more) can be established in

# Options|General. In v 4.6-4.8, if the below switch is set to

# "Edit lines with Default Viewer"=dword:00000001, the program will

# use the editor/viewer specified in the Options|General - 'If no

# association use' field instead of the internal context viewer.

# This means that if you double click on a search hit, your external

# editor/viewer will open the file. The default is:

# "Edit lines with Default Viewer"=dword:00000000

[HKEY_CURRENT_USER\Funduc Software Inc.\SR32\Settings]

# *** WORK PATH ***

# If you need to install sr32.exe in a path where you do not also have

# write permissions, use this setting to specify a path to use for

# the \Favorites folder and several temporary files created by the

# program during ordinary use. The temporary files are SRUNDO.BAT

# (created after each replace), EXPLORER.SRS (used for search/replace

# launched from Explorer, SrOut.htm (HTML Output dump), SRDUMP.SRS

# (generated by pressing ctrl+Script Editor toolbar button)

# "Work Path"=""

[HKEY_CURRENT_USER\Software\Funduc Software Inc.\SR32\FLAGS]

# *** UNIX GREP MODE ***

# NOTE: This switch is experimental and is completely unsupported.

# DO NOT USE this except on experimental data.

# You have been warned.

# To use UNIX-Style regular expression syntax instead of the style used

# by our standard Search and Replace syntax, uncomment the line below and

# remove the one after

#"UNIX RegExp"=dword:00000001

"UNIX RegExp"=dword:00000000


Read-Only Warning

Read-Only, System, Hidden Warning

The above warning message is provided if replacement confirmations are enabled (Options-Replace) and if Search and Replace determines that a replacement is about to be made in Read-Only, System, or Hidden files. Do not allow the types of files to be changed if you are unsure of your intentions.

To disable this prompt, turn off replacement confirmations in Options-Replace.


Unicode Files

Search and Replace v 3.7 automatically detects if a file is Unicode. Search and replaces will be handled seamlessly in most cases.

For users who are familiar with using earlier versions with Unicode files, it no longer necessary to use the 'text2uni.srs' script to convert your strings first.


UTF-8 Files

Search and Replace v 4.6+ automatically detects if a file is UTF-8 format if the name extension of the file .xml. Searches and replaces will be handled seamlessly in most cases, with the following notes:

  • If the file is Unicode it is handled as a unicode file.

  • If HTML Mode is enabled the program does not use UTF-8 special handling.

  • If an "Encoding="iso-...." statement at the top of the file the program will try to determine the file type according to the Encoding= statement and handle it accordingly.

  • The internal Context Viewer may not display all characters properly. You might want to configure the program to use your external editor/viewer instead of the internal context viewer when working with UTF-8 files. See External Context Viewer for more information.

  • Single ? characters during regular expression mode search/replace may not work properly if the character being found is an extended character. Use ?? instead. ? combined with the [ ] range operator will be OK.

  • The program's input fields and basic output will not allow you to easily deal with characters that are not available for your Windows language installation. For example, UTF-8 file or not, a user running a US English Windows installation will not be able to deal with a Chinese Big 5.


Word 97 Toolbar Error

It has been reported that troublesome Word 97 installations may suddenly report the following message:

"The application or DLL C:tools\sr\srext.dll is not a valid Windows NT
image. Please check this against your installation diskette."

The 'srext.dll' file is the Search and Replace Explorer extension. Why the Office 97 Toolbar wants to deal with this file is unknown.

Reinstalling the Search and Replace explorer shell extension seems to take care of the problem. The extension is available at any time from our web site. Visit the shareware download page at www.funduc.com/srshareware.htm and scroll down until you see the 'SRCLIENT.EXE' download link. Download that file. Reboot your computer. Run srclient.exe and then reboot again, even if you are not prompted to do so.


NT Task Scheduler

NT Task Scheduler Problems

Q: I want have a script I want to run from the NT 'at' scheduler. My script works OK when I test it but when run as an 'at' job I am told that the network path involved does not exist. What is going wrong.

A: There are several possibilities:

Try using the '/interactive' switch with your 'at' command. This may help if memory management problems are affecting your 'at' scheduler jobs. Conversely, if you are using the /interactive switch, try taking it out. This may be due to network permission issues and the AT scheduler. Some users have found it necessary to include network logon commands in their command script for the 'at' job. A larger issue is that, by default, the schedule service on NT logs on as system account with restricted network access. So when a cmd window is opened (by the AT command) access to network drives may be denied. Solution: If you configure the schedule service not as system service, but rather as one under your own account, which has access to the network drive, you should then have AT access those paths. You can configure this in the services window in the system panel. Also search the MS Knowledge Base for further information on the AT service. Some articles of interest include: Q142432, Q138340, Q130668, Q121562. Your NT/2000 administrator may need to configure your user account with permission to launch the schedule service. Also have the administrator verify that the network permissions for your user account are passed along with permissions to launch the schedule service. This probably happens automatically but run some tests while you have your administrator's attention.

Q: My problem is similar to the above but it does not seem to be a permission issue with the NT scheduler. Instead Search and Replace seems to simply not complete the scripted task. I sometimes get an error message.

A: We have never seen this first hand but, by report, make sure NT 4 SP6 is fully installed. Then install IE 5.5, which will upgrade to the 'Task Scheduler'. The 'at' command works well for many users but the Task Scheduler does seem to be more reliable overall.


Regular Expressions: Overview

Regular Expressions are used for advanced searches, where the search string follows a rule and is not always exactly the same. Regular Expressions employ "special character operators," which are symbols that control the search, and "an expression," which is a combination of meta characters and operators that specify a pattern. Regular Expressions can be used in replacements, they can make use of Binary Characters , Special Replacement Operators , Environment Variables , & Math Operations , and they can be case sensitive or not. You can also change the number of bytes to allow for regular expressions under Search Options .

Important: To use regular expressions you must activate regular expression mode by clicking on the toolbar button or selecting Regular Expressions in the Flags Menu. If Regular Expression is dim, make sure HTML Mode &/or Ignore Whitespace are turned off.

Search and Replace uses a Regular Expression syntax that is a subset of UNIX grep notation for Searching and DOS style Batch file %n input parameter notation, with extensions, for Replacing. The major differences between the Search and Replace and grep regular expressions are:

. operator is not supported

* + ? ! operators must precede an expression enclosed by () or []. Otherwise, the operator is assumed to match any/all characters from beginning of line or to the end of the line. For example, if used in Search and Replace, the grep expression [123]* would match the numbers plus everything to the end of the line. The Search and Replace counterpart is *[123], which would match just the numbers.

^ and $ cannot be used within a single search string. Unix grep can use expressions such as ^just_this$ to locate a string that is the only thing on a line. The Search and Replace counterpart is: ^just_this\r\n

Regular Expression Help Topics

Search Operators

Replacement Operators

Examples

Literal Characters

Special Replacement Operators


Regular Expressions - Enable Regular Expression Mode

'Regular Expression' mode must be turned on to use Regular Expression operators in a search (&replace). To enable Regular Expression mode do one of the following:

1) Click on the Regular Expression toolbar button.

2) Select 'Regular Expression' from the Flags Menu.

If you are using a script, there is a checkbox in the script editor to enable Regular Expressions for a given search/replace string pair.

Note: If 'Regular Expression' is dim or it seems like regular expression mode is 'deactivated' or disabled in some way for your installation, check the Flags menu and make sure 'Ignore Whitespace' and/or 'HTML Mode' are turned off. You may also need to disable Whole Word mode. Regular Expression mode cannot be combined with 'Ignore Whitespace' and/or 'HTML Mode'.


Regular Expressions Search Operators

Regular Expression Search Operators

Search Operators Index

Basic Operators
* - Zero or More
+ - One or More
? - Exactly One
| - Or Operator
! - Not Operator
^ - Start of Line
$ - End of Line
^^ - Start of File
$$ - End of File

Sub-Expression Operators
[] - Range Operator
() - Sub-Expression
+n - Column Operator

Additional Issues
 Notes on Search Expressions
Literal Characters
Operations in Word Documents & binary files

Related Topics
 Regular Expression Replacement Operators
Special Replacement Operators
Regular Expression Examples
Regular Expression Counter Operators
Regular Expressions Overview

Notes on Search Expressions:

  • The following characters have special meaning in regular expression search terms. If you wish to use the literal of one of these characters, preface them with the \ character.
    - + * ? ( ) [ ] \ | ^ $ !
    For example, to search for the \ character, you must use a double it (\\) in order for \ to be matched correctly when using Regular Expressions. See Regular Expression Literals for more information.

  • You may wish to increase the "Maximum Regular Expression Size" under Search Options if you have a regular expression search that involves Binary Characters and/or is very complex.

  • Please See Word Documents Notes for important information on search & replaces in non-text files such as Word documents, Word Perfect documents, spreadsheets, etc.

Regular Expression Search - Match Operators

*

Zero or More Operator: Matches zero or more expressions enclosed in () or []. * may be used by itself, although it is intended to be used around strings. If the * operator is entered alone it will match all characters from the start of the line to the end of the line. You can match characters between two or more strings up to the maximum regular expression size by specifying a range after the * operator. Entering several expressions in a row containing * should be done carefully to avoid overlapping matches which may produce unpredictable results.

Note: By design, * does not match characters under 'space' - ASCII 32 or 20 hex. If you need to search for a low order characters use the form *[] or *[\0x-00-ÿ]

*(is)
*[is]
Windows *[0-9]
Windows*[]95

Windows*[\0-ÿ]

matches
matches
matches
matches

matches

is, Mississippi
Some, Expression, single
Windows 95, Windows 98
up to 32767 characters (across several lines)
between Windows and 95
same as the above (older syntax)

Note: When * is combined with a numeric range and the %n>> or %n>starting value> replacement operators, the search expression above, Windows *[0-9], would be part of a Regular Expression Counter Operation.

Note: By design, * alone does not match characters under 'space' - ASCII 32 or 20 hex. If you need to search for all possible characters using *, use the form *[] or *[\0x-00-ÿ].

+ | One Or More Operator: Matches one or more of the occurrences of the expression. + is intended to be combined with () and care should be taken when using + by itself. For example,
 | +(is) w+e | matches matches | is, Mississippi wide, white, write but not we
 | Note: By design, + alone does not match characters under 'space' - ASCII 32 or 20 hex. If you need to search for all possible characters using +, including low order characters, use the form +[] or +[\0x-00-ÿ].

? | One Occurrence Operator: Matches exactly any character either before or after a string. ? also matches any character between two strings. When combined with (), ? matches exactly one expression enclosed in (). Using the ? operator by itself will match every character in a file one at a time and therefore probably should be avoided.
 | ?(is) Win?95 | matches matches | is Win 95, Win-95, Win/95
 | Note: By design, ? alone does not match characters under 'space' - ASCII 32 or 20 hex. If you need to search all possible single characters using ?, including low order characters, use the form ?[] or ?[\0x-00-ÿ].

| | Or Operator: Matches the simple expression either before or after the | (pipe) symbol. This should be used in conjunction with (). Or expressions should not contain other operators such as *+^$?. You may, however, make use of other operators outside the (). For example,
 | (01/|02/)+[0-9](/95|/98) w*[a-z ](98|NT)\? | matches matches | 01/15/98 & 02/12/98 Windows 98?, Win NT?

! | Not Operator: A match will be made when both a 'positive' hit component and a !() or ![] component of the expression are found. The complete expression requires both components. The first may be as simple as a single regular expression operator such as * or ?. You should provide a wild card operator of some type prior to the ! component. The ! component should be enclosed in () or []. Be sure to nest ( ) when using |, e.g., ?!(a|b) won't work - Use ?!((a|b)) instead. Multiple!() component can be used to create an 'or', e.g, ?!(a)!(b)!(c). You can also use other regular expressions inside ( ). Additional 'postive hit' strings &/or regular expressions to find may be specified after !() or ![]. Note, however, that regular expressions following the !() or ![] will not be available to the %n operators. See Not Operator Notes for more information.
 | ?at!((b|c)at) *file!(beg*file) *98!(Windows 98) *98!(+[a-z ]98) a?b?c!(aub?c)!(a?bvc) ^*!(^t)!(</p>$) #include*!()"C | matches matches matches matches matches matches matches | mat & sat but not 'b'at or 'c'at a file & this file but not 'beginning of file' 98 in 1998 but not in 'Windows 98' 98 in 1998 but not in 'Windows 98' In a search of 'aXbYc', find where X not 'u' and Y not 'v' Lines that don't begin w/ t or end with </p> "ChildFrm.h" in "#include "ChildFrm.h"" but finds nothing in "#include "Edit.h"". This example uses !() as an AND operator of sorts.

^

Beginning Of Line Operator: Matches an expression at the beginning of a line. ^ should be the first character in your search term. ^ is best thought of as an 'anchor' - it anchors the entire expression to the start of a line. ^ can be combined with other wildcard and operators, with the following qualifications:

- Only one ^ can be present in an expression. If you need to consider two 'beginning of line' terms, use line boundary characters (\r\n) as literals as in the example below.

- A search such as, \r\nFind this, is the same thing as ^Find this (if your files are PC format).

- ^ can be used in 'not' expressions but do not use ^ inside () expressions. Use *(\r)\n instead.

- Do not use ^ and $ in a single expression. If you need to anchor a search to the start and end of a line, use literal line boundary characters at the end of your term. For example, if your files are PC format, use something like ^find this as the only thing on a line\r\n. If you are making a replace, include \r\n in your replace string so you don't strip out the line boundary characters.

- The ^, $, ^^, and $$ operators are counted for the purposes of an %n operator in a replacement expression. For example, in the search expression ^+[ ][a-zA-Z], the corresponding %n terms are: %1 = ^, %2= +[ ], %3 = [a-zA-Z].

- A Trick/Tip: During replacements, Search and Replace assumes ^ in the replacement term so it is often not necessary to reference specifically reference ^ in your replacement string. For example, an operation to remove the first character from each line could use:
S:^?* R:%1%3
S:^?* R:%3

Some other examples of ^ are:

^the

^(the|[a<])

^*( )BEnd\r\n*( )Exit Function

^the*end.\r\n

matches

matches

matches

matches

the, The, THE, tHE at the beginning of a line
and if case sensitive is off.
the in The opening paragraph... OR
A in At 5 pm ... OR
< in <HR>
BEnd <immediately followed on next line by>
Exit Function
And entire line that begins with The and ends with end.

^*( )BEnd\r\n*( )Exit Function

matches

<space(s)>BEnd <immediately followed on next line by> <space(s)>Exit Function

^the*end.\r\n

matches

And entire line that begins with The and ends with end.

$

End Of Line Operator: The $ operator is similar to the ^ operator but anchors your search to the end of a line. $ can be use with other wildcard and subexpression operators with the following qualifications:

- Only one $ can be present in an expression. If you need to anchor a search to two line ends, use line boundary characters (\r\n) as literals. See below example.

- These two search terms are the same: FindThis$ FindThis\r\n (PC format files)

- $ can be used in 'not' expressions but do not use $ inside () expressions. Use *(\r)\n instead.

- Do not use ^ and $ in a single expression. If you need to anchor a search to the start and end of a line, use literal line boundary characters at the end of your term. For example, if your files are PC format, use something like ^find this as the only thing on a line\r\n. If you are making a replace, include \r\n in your replace string so you don't strip out the line boundary characters.

- Note: The ^, $, ^^, and $$ operators are counted for the purposes of an %n operator in a replacement expression. For example, in the search expression l+[ls]$, corresponding %n terms are: %1 = +[ls], %2= $.

Some examples of $ are:

end$
*L1End\r\n*L2End$

(the end|of a line.)$

matches
matches

matches

end only if it is at the end of a line
two sequencial lines, the first ending with L1End
and the second ending with L2End
the end in "This is the end"
of a line. in "the end of a line. "

^^

Beginning Of File Operator: Matches an expression found at the beginning of a file. Usage is similar to ^. Do not use ^^ inside ().

Note: The ^, $, ^^, and $$ operators are counted for the purposes of an %n operator in a replacement expression. For example, in the search expression ^^?omething, the corresponding %n terms are: %1 = ^^, %2= ?.

^^First

^^+50[]

matches

matches

First in "First line of the file" if that string is on the first
line of the file.
The first 50 characters in the file.

$$

End Of File Operator: Matches an expression found the end of the file. Usage is similar to $. Do not use $$ inside ()

Note: The ^, $, ^^, and $$ operators are counted for the purposes of an %n operator in a replacement expression. For example, in the search expression in the below, *$$, the corresponding %n terms are: %1 = *, %2= $$.

*$$

matches

The last line in the file

Regular Expression Search - Sub-Expression Operators

[ ]

Range Operator: This may be a list of single characters such as [gdo], one or more ranges of characters such as [d-o0-2], or a more complex expression using other match or sub-expression operators such as do[g|uble]. Ranges using an "a-z" type of notation and are parsed in the order of the table of characters in the Binary Mode - Binary Codes list. If you need to include the - character as a specific character, make it a literal by specifying \-. Use the ?, *, or + operators to modify the range to be matched by the [] sub-expression operator. When nothing is specified inside the brackets, [] matches all characters and is equivalent to ?[]. Be careful if you specify [] as the only string to search for -- it will match all characters in the file, one at a time. The term *[] spans across one or more lines up to the number of characters specified by Options-Search: Maximum Regular Expression Size. *[] is very useful for 'finding anything' between two other component of your search term. If ?, *, or + are not specified, expressions that use a range in [ ] match single characters. This is the same as specifying ?
Some examples are:

t[]e
H*[]d
<title>*[]</title>

*[0-9]
+[niewW]
[a-z]

matches
matches
matches

matches
matches
matches

The, Toe
Hello (cr -lf) World across two lines
All characters in the html title tag, even if they span
across multiple lines
234907, 5795 (or an empty string)
one or more strings such as Win, new, win
any lower case string if case sensitive is on
and any words if not case sensitive

Note: When [] is combined with a numeric range, the * operator, and the %n>> or %n>starting value> replacement operators, a search expression such as Windows *[0-9] would be part of a Regular Expression Counter Operation.

( ) | Subexpression Operator: Parentheses are used to denote one or more sub-expressions. This is usually combined with the OR operator - |. For example,
 | Win( 95|dows 95) | matches | Windows 95, Win 95

+n | Column Specifier: This is used to denotes the number of columns to match either before or after an expression. The Column Specifier may be used with a simple search term such as the expression +4The or in combination with other the [] or () sub-expression operators. A range of columns to match may also be specified, such as The+4-10. Note that you should combine the + operator with [] or () if you want to be clear about literal strings that serve as an anchor to the expression. Some examples:
 | w+2[a-z] +4[]w [ ]+5-15[0-9.] | matches matches matches matches | Wor in Hello World llo W in Hello World 100.01, 123.9, & 543.21 in Data1 100.01 Somethin' Dat2 123.9 Nuthin' Dataa3 543.21 and junk

Regular Expression Search - Special Literal Characters

- + * ? ( ) [ ] \ | $ ^ !

If you wish to search for any of these characters, they must be preceded by the \ character to be interpreted as a literal in a search.


Regular Expressions Replacement Operators

Regular Expression Replacement Operators

Replacement Operators Index

Basic Operators
%n Operator
< - Lower Case Operator
> - Upper Case Operator
%n>> / %n<< - Counter
%n>#> / %n<#< -Counter

Special Operators
Special Replacement Operators
Counter Operators
Number Parsing Replacements

Additional Issues
 Notes on Replacement Expressions
Literal Characters
Operations in Word Documents & binary files

Related Topics

Regular Expression Search Operators
Regular Expression Examples
Regular Expressions Overview

Notes on Replacement Expressions:

  • The operators’ matches can be replaced with nothing (removed). The case of the text matched can be changed. Matches can also be left intact. All operators may match some strings and therefore all should be accounted for in the replace expression.

  • The following characters have special meaning in regular expression replace terms. If you wish to use the literal of one of these characters, preface them with the \ character.
    % \ < >
    For example, the % character normally denotes the %n basic replacement operator. If you want to use a literal % character in your replace string, denote that as \%. See Regular Expression Literals for more information.

  • Up to 31 parameters may be used at once by referring to those over number nine by moving up the ASCII table, e.g., 123456789:;<=>?@ABCDEFGHIJKLMN. A complete list is present in the %n table. Dealing with a large number of %n terms can make for a very complex replacement term. Our Regular Expression Wizard may be helpful - it breaks out the number equivalents in the search term. Also consider using multiple steps to tackle your operation, perhaps via a multi-step script search-replace. In some cases several passes with simpler expressions is faster than one pass through your files with a highly complex expression.

  • To view the result of all replace operations, turn on the "Prompt on All" radio button under Replace Options .

  • You may wish to increase the "Maximum Regular Expression Size" under Search Options if you have a regular expression search that involves Binary Characters and/or is very complex.

  • Please See Word Documents Notes for important information on search & replaces in non-text files such as Word documents, Word Perfect documents, spreadsheets, etc.

Regular Expression Replacement Operators

%n

Basic Replacement Operator: The replacement operators use a %n convention, where n corresponds to a component in the regular expression search string. For example, %1 refers to the first expression in the search string, %2 refers to the second, and so on. The %n parameters may be used several times, omitted, or used in any order. Up to 31 parameters may be used at once by referring to those over number %9 moving up the ASCII table, e.g., 123456789:;<=>?@ABCDEFGHIJKLM.

See %n table for more information and examples.

Some examples of %n usage are:

Given the series:

Search Expression:
Replacement Expression:
Results:

Values:

<a href="http://wait.com">S1</a>
<a href="http://waitalot.com">S2</a>
<a href="http://wait*[]">*[]<
<a href="http://wait%1">(Slow) %2 <
<a href="http://wait.com">(Slow) S1 </a>
<a href="http://waitalot.com">(Slow) S2 </a>
%1 = *[]
%2 = *[]

Given the series:

Search Expression:
Replacement Expression:
Results:

Values:

<BR>
<BR>
(TAB)<BR>
^<BR>
<BR>
<BR>
<BR>
<BR>
Here, the absence of %1 in the replace expression
is used to eliminate spaces & tabs before <BR>.

Given the series:

Search Expression:
Replacement Expression:
Results:

Values:

#include [stdafx.h]
#include [my_include.hpp]
#include [sr32.h]
?include (<|\[)+[a-z0-9_].h*(p)+[\]>]
%1exclude [%3>.H%4>]
#exclude [STDAFX.H]
#exclude [MY_INCLUDE.HPP]
#exclude [SR32.H]
%1 - ?
%2 - (<|\[)
%3 - +[a-z0-9_]
%4 - *(p)
%5 - +[\]>]

< | Lower Case Operator: This is to be used in conjunction with %n, where %n< replaces the original matched expression with the lower case version. For example,
 | Given: Search Expression: Replacement Expression: Results: | MAKE THIS ALL LOWER CASE +[A-Z] %1< make this all lower case

> | Upper Case Operator: This is to be used in conjunction with %n: For example, %1> replaces the original first matched expression with the upper case version. For example,
 | Given the series: Search Expression: Replacement Expression: Results: | All words beginning with letter w. w+[a-z] W%1> All WORDS beginning WITH letter w.

%n>> %n<< | Plain Counter Operator: This is a special case of the %n>#> and %n<#< operators below, where no starting value is defined by the user. When used in conjunction with a numeric regular expression search such as *[0-9], %n>> and %n<< begin incrementing up or down with a value of +/-1 from the value of the first number found by *[0-9]. For example,
 | Given the series: Search Expression: Replacement Expression: Results: | page5.htm, page2.htm, page4.htm page*[0-9] page%1>> page6.htm, page7.htm, page8.htm
 | See Counter Operators for more information & examples.

%n>#> %n<#< | Start Value Counter Operator: An extension of the above, this operator allows you to specify a starting value for an incrementing replacement counter. %n>starting value> and %n<starting value< begin counting up or down with a value of +/-1 from the starting value you supply. This counter operator respects the number of digit places you supply. To begin incrementing upward with a value of 1, use the expression %n>0>. The expression %n>000> would begin replacements with a value of 001. Another example is:
 | Given the series: Search Expression: Replacement Expression: Results: | Var19, Var82, Var8 Var*[0-9] Var%1<100< Var99, Var98, Var97
 | See Counter Operators for more information & examples.

%n<%num format(Math Op)>

Number Operation: This is a Number Parsing & Math Operation. These operations take search terms that return strings of numbers and handle them internally as integer or decimal numbers (depending on your specifications). Arithmetic operations are optional. If present, they are specified in ( ) before the closing > character.

The format rules are much too complex to summarize here so please see Number Operations for more details.

Given:
Search For:
Replace With:
Results:
Explanation:

page5.htm, page2.htm, page18.htm
page*[0-9].htm
page%1<%d(E1-1)>.htm
page4.htm, page1.htm, page17.htm
Subtract 1 from the %1 term using whole integer math.

Regular Expression Replacements - Special Characters (Literals)

% \ < >

If you wish to replace any of these characters, they must be preceded by the \ character to be interpreted as a literal in a replacement.


Regular Expression Replacement Operators - %n Table

Below is a table listing the %n regular expression replacement codes for the counterpart regular expression search terms. Up to 31 search terms are addressable within a single replacement string. If all this is meaningless to you, scroll down for some examples and additional notes.

Search and Replace %n Codes

1 - %1

2 - %2

3 - %3

4 - %4

5 - %5

6 - %6

7 - %7

8 - %8

9 - %9

10 - %:

11 - %;

12 - %<

13 - %=

14 - %>

15 - %?

16 - %@

17 - %A

18 - %B

19 - %C

20 - %D

21 - %E

22 - %F

23 - %G

24 - %H

25 - %I

26 - %J

27 - %K

28 - %L

29 - %M

30 - %N

31 - %M

Details:

Regular expression replacement terms use a '%n" syntax to reference the various regular expression search operators. The %n terms move up the ASCII, beginning with 1. They can be put in any order in your replacement string.

Dealing with a large number of %n terms can make for a very complex replacement term. Our Regular Expression Wizard may be helpful - it breaks out the number equivalents in the search term. Also consider using multiple steps to tackle your operation, perhaps via a multi-step script search-replace. In some cases several passes with simpler expressions is faster than one pass through your files with a highly complex expression.

If you use a %n that does not exist in your search term, no harm will come. Try to avoid this though. (See below)

Below are some examples showing the correspondence between %n terms and the search term operators. S: and R: here mean 'Search for' and 'Replace with'. If you are experimenting, don't actually type S: or R:

Strings | Possible Replace Effect | Explanation
S:?at R:%1at | Cat --> Cat | %1 in the replacement references the ? term in the search string.
S:?a? R:%2a%1 | Cat --> taC | There are two operators in the search, therefore two %n's are possible in the replace. Here we are swapping the letters during the replace.
S:Cat*[-]+[0-9] & +[a-zA-Z]+[0-9\-] R:%3 \t %4 | Cat-6 & dog5 --> 12 <tab> 5 Cat-0 & bird1 --> 0 <tab> 1 | Count the number of regular search terms. There are 4: *[-], +[0-9], +[a-zA-Z], and +[0-9\-]. This means %1, %2, %3, %4 can be used in the replacement string. Here we are getting rid of the original text strings and the - character (if present) and just returning the numbers, separated by a <tab> character. In case you are wondering, \t is the regular expression code for "tab".
S:???+[0-9] R:%8%4 | Cat5 --> 5 | Here we used %8 in the replacement, even though there are only 4 search terms. Nothing will be output for %8. You should try to avoid these situations though.


Regular Expressions - Literals

The following characters have special meaning when regular expression mode is enabled. If you wish to use a 'literal' of one these special characters, precede it with the \ character.

Expression Type | Special Characters
Search Expressions | + * ? ( ) [ ] \ | $ ^ !
Replacement Expressions | % \ < >
Building Scripts (see note below) | In addition to the above, [ and ]

Examples:

Goal: Find (1.1MB), (340K), (self-install)

Search Term: \(*\)

Explanation: The ( and ) characters are normally related to the () paren search sub-expression operator. If you don't preface the ( and ) characters here with \, the program would interpret the search as one involving () paren and you might not get the results you want.

Goal: Page references in html code that begin with the letter D and change them to lower case.

Search term: .htm*">D*</a>

Replace Term: .htm%1"d%2<\</a>

Explanation: The < and > characters in a replacement expression are characters used by the counter and case change operators when they are immediately adjacent to a %n operator. Because the literal < character in the ending </a> tag is adjacent to %2, the program would not know if how to interpret <. Therefore make it a literal.

Special Note about Scripts:

If you are using search/replace(s) in a script that creates or modifies another script, special care should be taken with the [ and ] characters. Search and Replace scripts contain several special 'section tags' that are bounded by [ and ]. For example, a script can contain an [Options] section (see Format of Script files for a complete sample). You should preface [ and ] with the \ character to avoid confusing the script parser. For example, say you have Script1.srs that transforms a given file into a working script by creating [Search] and [Replace] sections. You should preface the [ and ] characters with \ to avoid confusing script parser as it reads Script1.srs.

Other Regular Expression Hlp Topics

Search Operators

Replacement Operators

Examples


Not Operator Notes

Not Operator - Additional Notes

Here are some general notes about the Regular Expression 'not' operator, !.

  • 'Not' expressions can be thought of a being divided into two parts - an 'expression to search for' component and one or more 'not' component(s). The '! part' always goes to the right of the expression to search for.

  • The 'expression to search for' component must include some type of regular expression search operator. This is because the 'not' component needs some kind of regular expression material to consider when evaluating whether the overall expression is satisfied.

  • To qualify the above, the 'expression to search for' part could be a non-regular expression term but if you search for 'something' but not 'part of something' you would end up with no hits. There is a further qualification to this… see below.

  • 'Not' components must be surrounded by paren characters. A common mistake can be seen with the 'or' operator, |. 'or' itself must be surrounded by paren's. Therefore, if you use | in a not expression, double the paren's. For example, cat*!(hat|dog) would not work. Use cat*!((hat|dog)) instead.

  • Consider the search expression, xref?!(=), where you want to find all instances of the string 'xref' except if followed by the = character. In words, this can be described as - "Find xref followed by anything. If the 'anything' that is returned by the ? operator is the = character, reject that search hit".

  • It is OK to use multiple !( ) components. For example, cat*!(hat)!(dog) is also OK.

  • Consider the search expression, img src="*.gif*!(images/)!(alt="+[]"). In words, this means "find img scr=", followed by anything, followed by .gif, followed by anything all the way to the end of the line. If either of the 'anything' text returned by the *'s contains the string 'images/' or alt=" " that not empty, then reject the hit. This string would find <img src="earth6.gif" alt=""… but not <img src="images/earth6.gif" alt="Graphic pic"… or <img src="earth6.gif" alt=" (1019 bytes)"…. Note that in the search expression, alt="*[]" would not work. * is the 'zero or more' operator -- it will always be true if any type of alt=" " is present.

  • As modeled above, it is OK to use other regular expression search operators inside your ! operators. Another example: ^*!(^t)!(</p>$). In words, this means "find anything from the start of the line to the end of a ling, except if the first character on the line is the letter t or if </p> is at the very end of the line.

  • When using ! with replacements, don't forget to specify the search expression literals in your replacement expression. For example, given the search expression ?at!((b|c)at) in a replacement to put quote characters around all strings ending in 'at' (except if they begin with 'b' or 'c'), the replacement expression would be "%1at". The 'at' string must be specified in the replacement expression because that is a literal in the search expression.

  • Null ! expressions can be employed as a type of "and" operator by specifying !() alone. For example, div*!()(center|right) will work. In words this means, "Find div followed by anything. If there is 'not nothing' in the * part, then check for (center or right). If either exist, then return the hit.

  • Another example: *void*!(end)!()printing . This expression finds 'virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);' but not 'virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);'.

  • The components of the expression following the ! operator cannot be accessed via an %n replacement operator. For example, in the expression div*!()(center|right) above, there would be no %2 operator for use in a replace expression.

See ! - Not Operator for additional examples.

If you are transitioning from versions earlier than v 3.0, see Not Operator Changes and Old Syntax Examples for more information.


Regular Expression Counters

Regular Expression Incrementing Counters

Also see

Regular Expression Counter operations allow you to revise a sequence of numbers in one or more files. The program can also insert sequential numbers in strings where no numbers exist originally. Counter operations use the ?[0-9], +[0-9], or *[0-9] regular expression search operators and the %n>user defined starting value> or %n<user defined starting value< regular expression replacement operators. Counter increment +/-1 from the starting value specified. If no value is supplied, as in %n>> or %n<<, then incrementing begins with a value of +/- 1 from the value found by your *[0-9] expression. For example, if the value found by the *[0-9] search expression is 10, %n>> begins at 11.

The %n>user defined starting value> and %n<user defined starting value< replacement operators respect the number of digit places supplied. For example, the expression %1>1> begins incrementing with 2. The expression %1>000> begins incrementing with 001.

Negative values can be used for the starting value. For example, %1>-5> replaces with -4, -3, -2, -1, 0, … .

Arithmetic calculations are not available for counter operations. The?[0-9], +[0-9], or *[0-9] operators do not perform numeric evaluations. These are ordinary [ ] range operators that search for the characters 0 to 9. Keep this in mind if you are searching for number strings along with $ or . characters. A search for +[\$.0-9] finds '$53.00' but the program does not interpret this as 'fifty-three dollars'. Counters will not work in this case. The - (minus) character is an exception. +[\-0-9] is OK for counter operations involving search hits such as '-53'. If you need to do searching-counters for strings like '$53.00', consider a search string such as \$+[0-9].+[0-9] and (perhaps) a replace such as $%1>>.%2.

Incrementing counter operations may be combined with other regular expression search & replace operators. For example, a search expression such as (file|variable)*[0-9] with a counter replacement expression such as %1%2>100> is allowed.

If the search uses multiple?[0-9], +[0-9], or *[0-9] search terms the replacement can use different counter terms. Example: Search - cat*[0-9] dog*[0-9], Replace - cat%1>> dog%2>100>. Please note that the replacement term should maintain the positions of the %n terms in the search string. Do not, for example, use cat%2>> dog%1>100> in a replace string.

By default %n>user defined starting value> & %n<user defined starting value< reset with each file if your search spans multiple files. See the "Multiple Files - Default Behavior" example below.

A special registry switch can be used to cause %n>user defined starting value> & %n<user defined starting value< replacements to sequence across files. The special configuration utility on the Search & Replace home page can also be used to activate the "Count Across Files" switch. The switch can also be used in manually created scripts.

See the "Multiple Files - Sequence Across Files" below for examples of the behavior when the program sequences across files. The order in which the files are processed is determined by the sort order of files in the Search Results list. This can be adjusted via the 'Sort search results by' field in Options-Search. For example, given FILE1.TXT and FILE2.TXT, a sort order of File Name-Ascending causes FILE1.TXT to begin the sequence. A sort order of File Name-Descending causes FILE2.TXT to begin the sequence.

Regular Expression Counter Examples
Initial Contents: Search String: Replace String: Results: | Windows 98 will be released in 5 days. *[0-9] %1>> Windows 99 will be released 100 days.
Initial Contents: Search String: Replace String: Results: | file.htm, file.htm, ffillee.htm e*[0-9].htm e%1>>.htm file2.htm, file3.htm, ffillee4.htm
Initial Contents: Search String: Replace String: Results: | Var22 Var20 Var86 Var30 Var*[0-9] Var%1<50< Var49 Var48 Var47 Var46
Initial Contents: Search String: Replace String: Results: | Var22 Var20 Var86 Var30 Var*[0-9] Var%1>00> Var01 Var02 Var03 Var04
Initial Contents: Search String: Replace String: Results: | VarA101 VarB12 VarC0 VarA102 VarB45 Var[a-z]*[0-9] Var%1%2>08> VarA09 VarB10 VarC11 VarA12 VarB13

Regular Expression Counter Example
Multiple Files - Default Behavior

File1 Contents:
File2 Contents:
Search String:
Replace String:
File1 Results:
File2 Results:

cat01 dog01
cat20 dog15
cat*[0-9] dog*[0-9]
cat%1>01> dog%2>04>
cat01 dog05
cat01 dog05

Regular Expression Counter Example
Multiple Files - Sequence Across Files

File1 Contents:
File2 Contents:
Search String:
Replace String:

Sort Order:
File1 Results:
File2 Results:

Sort Order:
File2 Results:
File1 Results:

cat01 dog01
cat01 dog01
cat*[0-9] dog*[0-9]
cat%1>009> dog%2>019>

File Name-Ascending
cat010 dog020
cat011 dog021

File Name-Descending
cat011 dog021
cat010 dog020


Regular Expression Number and Math Operators

Number parsing and math replacement operations can be done when a regular expression search term returns a string containing number characters and (optionally) ., -, & + characters. The search term should use an approach similar to Counter Replacements. For example, +[0-9] or +[0-9.\-] can be used in the search term to pick up number strings.

The replacement string syntax is:

%n<[%flags][ width][ .precision] type(Math Operation)>

The replacement string begins with the %n replacement term to operate on. Following that is the math term, which is enclosed in < > characters. A percent sign - % - must come immediately after the opening < character. The optional + - / * math operation must be enclosed in ( ) characters and must come just before the closing > character. E1, E2,.E2,... are used within the (Math Operation) section to reference the string found by your search term. More detail about this is provided below.

Some sample strings to help you get oriented are: %1<%06ld> and %1<%010.2lf(E1+10)>.

Please see Number Format Overview for more information about the syntax.

Performing + - / * Operations:

To perform a math operation on the found string, specify the format you want and then surround the math syntax inside ( ). Put this just before the closing > character for that component of the replace term.

Use E1, E2, E3, ... etc to reference the Search and Replace %n operator to use. For example, if %1 is the found string you want to do a math operation on, use E1. If %3 is the found string of interest, use E3.

It is up to you to make sure the two correspond! The program currently does not check for errors here. You could do something like %1<%d(E4/2)>, which references %1 for the number formatting but then divides %4 by 2. Obviously this would be silly.

General Comments:

  • The syntax can be technical. Plan on experimenting. Use the 'Display Replace String' setting in Options|Output to see what the replace would be while doing a search-only pass.

  • Keep good backups while you experiment.

  • Because of a limitation with simple integers, you must use the f-type if the number found is 10 or more digits long.

  • We suggest using literals around your number term search to anchor your search/replaces. If the material of interest is difficult to isolate, consider performing an initial replace to establish some temporary placeholder string(s), then perform your number replacement, then clean up the temporary placer(s). For example, if you search for +[0-9] you will get hits on every number in your file(s). If you can search for, say, +[0-9].tmpjpg, it will be easier to experiment with - and implement - your number operation.

  • Technical users may correctly suspect that the above syntax is derived from Microsoft's printf and wprintf Functions. Note, however, that not all possibilities apply - or are practical - for Search and Replace. Therefore, please see Number Format Overview for an overview of what is possible with Search and Replace. The n, s, and S data types are not supported by Search and Replace so if you use those they will be ignored. There is some limited support for some printf style type prefixes but in 99% of cases you should not specify anything for a type prefix.

    • Examples
Replace String | Effect
%1<%06ld> | This replaces the found string of numbers with the same thing, 6 places wide, 0 padded to the left.
%1<%06lf> | As above but as a floating point number. %4.2lf can set precision.
%1<%d(E1/2)> | Integer arithmetic format followed by a simple arithmetic operation. Note the E1 term. That refers
%1<%06X(E1*3)> | Hex format with arithmetic operation
%2<%0.2f(E2+10)> | Given a search term, +[0-9].+[0-9] test, this replace would return the second +[0-9] component of the search hit, plus 10, two decimal places. Note that you could specify %2<%0.2f(E1+10)> but the results will probably be silly because the program would be doing math on the %1 term.
%1<%010.2lf(E1+10)> | Similar to the above but this is padded with 0's.
+[0-9.\-] bytes | %1<%4.3lf(E1+22)>


Regular Expression Number Formatting Overview

The complete replacement string syntax for a number/math operation is:

%n<%[ flags ][ width ][ .precision ] type(Math Operation)>

The replacement string begins with the %n replacement term to operate on. Following that is the math term, which is enclosed in < > characters. A percent sign - % - must come immediately after the opening < character.

The number format fields are marked with the arrows. type is the only required field so it marked with blue. The [ and ] characters you see above are for display purposes only. They are not included in actual practice.

The simplest number replacement string that has the minimum required characters is something like: %1<%d> or %1<%f>.

The number format fields are:

type

This is Required. This character that determines whether to interpret the argument as a character, a string, or a number. See Type Field Characters for the complete details. Examples:

%1<%d> - Given a search term of +[0-9.\-] that returns number strings like +22.5 and -100, d specifies signed decimal integers. Therefore this will output the whole integer.

%1<%f> - Given the same search term, f tells the program to use floating point math. This returns the floating point value, defaulted to 6 places after the decimal.

%1<%+4.2f> - Given the same search term, this outputs a + if the number is +, - if it is -, 4 wide, 2 places after decimal. Note that - is always returned if the value is negative. + simply forces the program to output a literal + as well if the value is positive.

%1<%c> - The c specifies to return the ACSII character that corresponds to the number string found. Given a search term of +[0-9.\-] and a hit on the strings '67' and '98', the output would be the characters C and b. In the ASCII table, C is character 67 and b is character 98. Of interest, if you want to see an ASCII table, go to the Search and Replace Binary Mode dialog and scroll through the Binary Codes list.

flags

The flags are optional character(s) that control the justification and output of signs, blanks, decimal points, & octal / hexadecimal prefixes. See Flag Characters for details. For Search and Replace, the - flag is meaningless. + is supported. You can pad with spaces or 0's. Examples:

%1<% 12.3f(E1-10)> - Subtract 10 from the number found by the first search term, output as 12 wide, space padded, 3 places after decimal.

%1<%+06.2f(E1-10)> - Subtract 10, put + in front of positive numbers or - for negative, output at least 6 wide, pad with 0's.

width

Width is an optional number that specifies the minimum number of characters to output. In most cases this goes hand in with .precision, although you don't need to specify .precision. See Width Specification. Examples:

%1<%5d(E1-2)> - Subtract 2 and output a minimum width of 5, using integer math (the d specifies decimal integer).

%1<%5f(E1-2)> - Similar to above but since f is specified, a default of 6 places after the decimal are output.

%1<%5.2f(E1-2)> - This adds a precision spec of .2. Now the output will have 2 places after the decimal.

.precision

Precision is an optional number - always preceded by the . character - that specifies the number of characters / characters output. printed for all or part of the output field, or the minimum number of digits printed for integer values. See Precision Values. Examples:

%1<%5.2f(E1-2)> - A precision spec of .2, this outputs 2 places after the decimal.

%1<% 12.6f(E1-2)> - This outputs 6 places after the decimal. The number will be a minimum of 12 wide, padded with <space> if necessary.

Note: This material is taken from the MSDN Run-Time Library Reference, Format Specification Fields: printf and wprintf Functions.


Regular Expressions Examples: Overview

Regular Expression Examples Overview

Note: For all the replace operations, you can see the result of the operation by turning on the "Prompt on All" radio button under Replace Options .

Three sets of examples are available:

Some Basic Regular Expression Search Examples

Additional Regular Expression Search Examples

Search and Replace Regular Expression Examples

Also see

Regular Expressions Overview

Regular Expression Search Operators

Regular Expression Replacement Operators

Regular Expression Counter Operators

Special Replacement Operators


Regular Expressions Examples: General Search

Some Basic Regular Expression Search Examples

Also see

Some Basic Regular Expression Search Examples
What to Match | Operator | Examples
Any single character | ? | g?t finds get, got, gut, together
Any string of characters (one or more) | + | w+e finds wide, white, write but not we
Any string of characters (or none) | * | w*e matches wide, white, write and we
One of the specified characters | [] | g[eo]t matches get and got but not gut
One of the characters in a range | [-] | [b-p]at matches bat, cat, fat, hat, mat but not rat or sat
All characters | [] | l[] matches line, list, late
One expression or another | (|) | W(elcome to|indows 2000) matches Welcome to or Windows 2000
One or more expressions | +() | +(at) matches atat in catatonic and at in battle
All characters (perhaps on different lines) | *[] | h*[]d matches helped, Hello World, & Hello (cr lf) Win95 World. Use [] instead of complicated range expression such as [a-zA-Z0-9]. This will span across lines up to the limit set by Maximum Regular Expression Size (Search Options).
Two strings "nearby" (perhaps on different lines) | *[] | the*[\0-ÿ]first matches the first and the (cr lf) very first Note: This is an older style syntax using Binary characters.
A string that doesn’t start with an expression | !() | *: !(http) finds : in following: but not in http://www.funduc.com
One of the characters not in a range | ![-] | [a-z]at!([b-p]at) matches rat & sat but nothing in bat, cat, hat. Note: Older syntax for this would be ![b-p]at
Find all words of length x |  | +x[a-z], e.g., +3[a-z] finds all 3 letter words. Note: We previously supplied a ! operator example here. By way of example, to do this with a ! operator, the expression would be ?+3[a-z]?!(?[a-z]+3[a-z]?[a-z]). This would not be an efficient approach however.
An expression at the beginning of a line | ^ | ^the finds the at the beginning of a line and The if case sensitive is turned off.
An expression at the end of a line | $ | end$ finds end when it’s the last string on a line.
One or more column(s) before or after a string | +n | [h]+4// finds http:// but not https://


Additional Regular Expressions Search Examples

Additional Regular Expression Search Examples

Also see

Additional Regular Expression Search Examples
Search String | Match
L[] | line, list, lane, LogVar1 (when case sensitive is off)
[on] | non, no, on
\[ | [
+[a-z] | abcdefghijklomopqrstuvwxyz Note: If used with Case Sensitive off, it will also match ABCDEFGHIJKLMNOPQRSTUVWXYZ
[a-zA-ZÀ-ÿ] | matches the same as the +[a-z] example above (regardless of case sensitive flag) and also all other special characters for Western European languages. See the Binary Mode dialog for the order of those characters in the ASCII table.
+(one|two|three) | one, onetwo, twothree
?(one|two|three) | one, two, three
Windows*[\0-ÿ]95 | Will match up to 32767 characters (on several lines) between Windows and 95.
All * replaces | all the replaces (the * character matches all chars on the same line unless a [] expression overrides that - see above)
/**[\0-ÿ]*/ | Matches C style comments on several lines if necessary (up to 4069 characters)
01*[0-9].htm | 01346.htm, 01.htm, 016965.htm
*[ab]c | c, abc, bac, abbc, bbac

?include (<|\[)+[a-z0-9_].h*(p)+[\]>]

Matches:
#include [stdafx.h]
#include <dos.h>
#include [my_include.hpp]
#include [sr32.h]


Regular Expressions Examples: Search and Replace Examples

Search and Replace Regular Expression Examples

Also see

Regular Expression Search & Replacement Examples
Search String | Replace String | Effect
*.* | %1>.%2> | c:\windows\win.ini => C:\WINDOWS\WIN.INI
+[a-z] | %1> | Windows => WINDOWS
7*.htm | 5%1.htm | 711.htm => 511.htm 7days.htm => 5days.htm
[253]7[832].htm | %15%2.htm | 3572.htm => 3552.htm
*[253]7[832].htm | %15%2.htm | 72.htm => 52.htm
(homepage|index).htm | %11.htm | homepage.htm => homepage1.htm index.htm => index1.htm
+(12)*[0-9] | %1%2a | 12532 => 12532a 1212753 => 1212753a
*(d|m).htm | %1%2%3d1.htm | card.htm => card1.htm form.htm => ford1.htm
*[\r]\n!(\r\n) | \r\n | Converts UNIX to DOS end-of-line termination.
?(Windows) | OS/2 | Windows => OS/2 (just kidding)

back2.jpg*[]height="30"

back2.jpg%1height="32"

src="images/back2.jpg" alt="Go Back" border="0" width="57" height="30"

becomes:

src="images/back2.jpg" alt="Go Back" border="0" width="57" height="32"

Note: This search - replace changes the height setting for 'back2.jpg' regardless of differing 'alt' text or how the html editor line breaks the code across lines.


Special Replacement Operators Overview

Search and Replace has the following special replacement operators:

Operator | Function
%1<%0.2lf(E1/2)> | A special Number Replacement that returns the %1 term number string divided by 2. The string retuned will have 2 decimal places.
%%srfound%% | Returns the current search string.
%%srfound %% - Special | A special form of the %%srfound%% operator can be used to strip specified characters from the search hit. See %%srfound %% - Special for more information.
%%srpath%% | Returns the path of the current file
%%srfile%% | Returns the file name
%%srfiledate%% | Returns the current date stamp of the file. This is the date prior to a replace made by Search and Replace.
%%srfiletime%% | Returns the current time stamp of the file. This is the time prior to a replace made by Search and Replace.
%%srfilesize%% | Returns the file size prior to the replace made by Search and Replace.
%%srdate%% | Returns the current date of the machine.
%%srtime%% | Returns the current time of the machine.
%%srprepend%% %%srappend%% | See Special Script Prepend-Append Operators for more information.
%%srformat%%=xx | A special binary search operator, %%srformat%%=xx, is used to Reformat Files at the specified column, xx.
%%envvar=winbootdir%% | An example of the Environment Variable function. This replace would return the machine environment variable, Winbootdir. This type of string can also be used in the search string.
%%today%% | This is not a replacement operator. %%today%% is used in manually created scripts.

Notes:

  • The above are replace operators, not search operators.

  • These operators may be used in ordinary search & replace operations, Regular Expressions , Regular Expression Counters , Scripts , and Binary Mode operations.

  • It is not necessary to activate Regular Expression mode to use the above operators. They can be used in the Binary Mode replace string dialog and the main dialog replace field without enabling Regular Expression mode. For example, the first sample below does not require regular expression mode.

  • The Environment Variables operators may be used with regular expressions.

    • Special Replacement Operator Examples
Ordinary Search/Replace |
File Searched: Initial String in File: Search String: Replace String: Results: | D:\Example\Test.txt Page No. Page No. %%srpath%%%%srfile%% Page No. D:\Example\Test.txt Page No.
Complex Search/Replace |
Files Searched: File Mask: Initial String in Files: Regular Expression Search String: Binary Mode Replace String: Results: | home.htm; index.html *.htm* Last Updated: 10/10/97 and Last Updated 10/12/97 Last Updated: *[0-9]/*[0-9]/*[0-9] Last Updated %1/%2/%3\r\nUrl: %%srfile%% Last Updated: 10/10/97 Url: home.htm and Last Updated: 10/12/97 Url: index.html

    Note for Advanced Users:

    %%srpath%% and %%srfile%% can be used in Command Line operations. However, some extra steps will be necessary to deal with the "%%" characters.

    For example, on a Win95 machine, the following SET commands:
    SET T=%%%
    SET P=srpath
    SET F=srfile

    and the command line:
    SR32 /I /Pexample.txt /S"Page No." /R"%t%%p%%t%%t%%f%%t%, Page No."

    replaces all instances of the string Page No. in the file example.txt (which is in the path d:\example) to d:\example\example.txt, Page No.

    Consult your operating system manual for further information on how to pass the literal %% characters to the command line.


Special Replacement Operators - %%srfound %% Special Operation

A special extension to the %%srfound%% special replacement operator is available to remove one or more characters from the search hit. The form is:

%%srfoundcharacters to remove specified here%%

where characters to remove specified here is one or more characters which, if present in the search hit, will be removed from the replace.

Regular expression mode is not required for this special extension.

%%srfound %% Special Replace Examples
Search String: Sample Search Hit: Replace String: Replace Results: Explanation: | Find Me Find Me %%srfound de%% FinM The replacement string removes any instances of space, 'd', and 'e' characters from the search hit. Therefore if a replace is permitted all instances of the string 'Find Me' would be changed to 'FinM'
Search String: Sample Search Hit: Replace String: Replace Results: Explanation: | Find*Me Finding some meteors %%srfoundie%% Fndng som mteors The special %%srfound%% function works with regular expression search hits. Regardless of what is returned between the strings 'Find' and 'Me', all instances 'i' and 'e' would be removed.
Search String: Sample Search Hit: Replace String: Replace Results: Explanation: | +10[0-9 .]*[0-9.] 331.3954 3328 %%srfound. \t%% 33139543328 This is another regular expression example. Here, any '.', space, or tab characters that are present in the search hit would be removed upon a replace.


Special Replacement Operators - Special Script Prepend-Append Operators

In addition to the standard special replacement operators are the below two operators for script usage only. These switches can only be used in scripts! Furthermore, they can for use only if you create or edit a script manually with a text editor. The Search and Replace internal script editor defaults to another syntax when saving a script that used prepend or append.

The intended usage for these operators is for a script that performs a Prepend or Append operation that will work across language modules. The Search and Replace script editor normally uses language dependent strings in the [Search] section of a Prepend or Append step. Edit your script manually and use %%srprepend%% or %%srappend%% if you want it to work across languages.

Operator | Function
%%srprepend%% %%srappend%% | These are special operators that may only be used in script search/replace operations. They cause the program to use the special binary mode replace operations, Prepend or Append. Prepend and Append insert the replace string at the top or bottom of the file. These operators do nothing during a search.

Raw script syntax Examples: These code sections would put the respective strings at the top and bottom of a file during a replace.

Default syntax - For English interface. If you use a language module the strings in the [Search] section will be in that language:

[Search /bi]

This search string will not be used

The replace block will be added at the top of the file.

[Replace]

Put this string at the top ...

[Search /bi]

This search string will not be used

The replace block will be appended to the file.

[Replace]

... and this would be appended to the end

Alternative form - This form works whether or not a language module is in place. You must edit the script manually to specify %%srprepend%% or %%srappend%%:

[Search /bi]

%%srprepend%%

[Replace]

Put this string at the top ...

[Search /bi]

%%srappend%%

[Replace]

... and this would be appended to the end


Environment Variables

You can search for, or make replacements with, Environment Variables. Searches may be case sensitive or not and can use a Regular Expression strings.

The syntax is:

%%envvar=variable name%%

where variable name is the name of the environment variable to use.

For example, to search a string held in the environment variable temp, uses this search string:

%%envvar=temp%%

If the value of your temp environment variable is C:\Users\tom\AppData\Local\Temp , search hits will occur wherever the string C:\Users\tom\AppData\Local\Temp is found in the files being searched. If Case Sensitive is on, C:\Users\tom\AppData\Local\Temp would be found but C:\USERS\TOM\APPDATA\LOCAL\TEMP would not.

To use the value of the environment variable SystemRoot in a replacement string, enter the string

%%envvar=SystemRoot%%

in replacement text field. If the value of SystemRoot for your computer is variable is C:\WINDOWS, the string C:\WINDOWS would be used in replacements.

A regular expression operation involving the environment variables operators might be:

Search:
Replace:

*%%envvar=tmp%%
%1 settings:\r\nTMP=%%envvar=tmp%%\r\nPROMPT=%%envvar=prompt%%\r\n


Special Replacement Mode - Capitalization

Capitalization matching is enabled in Options|Replace and scripts. using the Replace Processing switch. This is a special mode in which the program either capitalizes or uses the letter case of existing text while making a replacement. A 'word' consists of an alphabetic string surrounded by whitespace. The replacement string does not have to be the same length as the search string. For example, if your search gets a hit on the 'word' Cat, you can change that Mouse also change letter case at the same time. Regular expression mode can be enabled or not.

Special Note: Replace Processing is a special operation that should be enabled only if you need it. It is intended for simpler search/replaces. In particular, the 'Match Case' choice functions best when the search term has clear literal boundaries. Please test complex regular expression mode search/replaces with the 'Match Case' choice enabled in advance. The program tries to determine the existing letter case by 'words' surrounded by whitespace. If the existing text is mixed letter case within 'words' or the search term yields 'words' that contain non-letter characters or line boundaries, the program may have trouble determining the existing letter case. You can preview replaces by enabling Display Replace String in Options|Output and running a search. If results are not what you expect, try using a more narrow search term.

Three Replace Processing choices are available:

None: Standard mode. No special letter case changes made.

Capitalize All Words: The program capitalizes 'words' while making the replacement. For example, if the search string is coffee or tea and the replace string is bitter or sweet, the replace would be Bitter Or Sweet. This mode can be used with regular expressions. For example,

S:<title>*</title>

R:<title>%1\</title>

will change <title>funduc software inc</title> into <Title>Funduc Software Inc</Title>.

Match Capitalization: If the letter case of the existing text found is consistent within "words" the program will match the overall capitalization of the search hit and apply that while making the replace. For most searches this means if the first two alphabetic characters of the first 'word' is lower case, the replace will be lower case and visa versa. If the 1st is capital and the 2nd is lower, the replace case is 1st letter cap, remainder lower. If the search and replace strings differ in length, the pattern detected in the search will be continued forward replace string. This mode can be used with regular expressions. Some example are below.

File Contents S/R Strings Result

Cats or Mice S:cats or mice

R: mice n rats or cats Mice N Rats Or Cats

cats or mice "

" mice n rats or cats

CATS OR MICE "

" MICE N RATS OR CATS

caTs or mICE "

" mice n rats or cats

CATS or mice "

" MICE n rats or cats

CATS or mice S:ca* or mi+[a-zA-Z]

R: mice n rats or cats MICE n rats or cats

Cats Or Mice "

" Mice N Rats Or Cats


Binary Mode Special Operator - Reformat File

Binary Mode Special Operator - Reformat Files

Search and Replace has a special binary mode search operator, %%srformat%%=xx, which is used to run a special search/replace mode that allows you to reformat the files found by your mask and path parameters at the column specified. The lines will word wrap at the column specified. The left indent is determined by the indent of the first line in that "paragraph". Paragraphs are bounded lines that consist only of cr-lf. If the left indent varies within paragraphs, lines within paragraphs are aligned with the indent of the first line in that paragraph.

To use the %%srformat%%=xx binary search operator and the reformat function:

1. Click on the [image] button next to the Search string in the main window to activate the Binary Mode Dialog.

2. Enter the string,
%%srformat%%=xx
where xx is the column to break & reformat the lines at.

3. Select OK to close the dialog.

4. Perform a Search/Replace. After confirmation the file(s) will be reformatted & word wrapped at the column specified.

Caution: Use this function only when you are sure the change will not damage your file. Binary files should not be modified using this function. You should also avoid using this with html files as the results may upset your html code.

Note: The Search and Replace 'reformat' function is not a 'file format converter'. It does not, for example, convert .doc files to .txt files.


Search and Replace Scripts Overview

Also see Format of Script Files

The Script dialog allows you to create and edit Search and Replace scripts. You can use scripts to:

  • Specify multiple search/replace combinations for processing; Save Search or Replace strings for later use; Process multiple drives/directories and/or file masks.

  • Apply a Script to the search &/or replace string in advance of a later operation.

  • Override the Search and Replace strings in the main dialog but still use the Masks and Paths; Override anything but the list of paths; Use only the Search/Replace list in a script.

  • Interactively insert the current main dialog search/replace strings and mask/path into a script (see Search/ Replace Items & Paths/File Masks).

  • Quickly import a list of search &/or replace strings via a simple script (see Format of Script Files).

  • Make decisions about the files to be processed via the Advanced Script settings and boolean Expression Evaluator.

  • Automatically run a search/replace several times to complete a complex operation via an iteration operator.

  • Chain scripts to follow each other sequentially via the Linked Script specification.

Notes:

  • If you are running a script from the command line, add the /s switch to launch Search and Replace and automatically initiate a search. If your script involves a replace, use /r in your command line to initiate the replace.

  • Script-oriented keyboard shortcuts are available: a) CTRL + Main Dialog Script Button - writes all program settings to SRDUMP.SRS in the same path as sr32.exe, b) CTRL+ Insert in Script Dialog - Inserts the respective lines from the main dialog into that script dialog tab, c) CTRL+ Remove All in Script Dialog - Deletes all current entries and add respective lines from the main dialog into that script dialog tab.

  • Scripts are stored in ASCII text files that can be edited or printed with any text editor (see Format of Script Files ). Comments can be added via the Advanced Script dialog and manually. To convert scripts created with earlier versions of the program, load them and then save them using the same name.

  • You can enter Search strings only, both Search and Replace strings, Path and mask strings only, or all the fields in a script. You can also override some of the values from the main window by entering new Search and Replace strings or new Path and Mask strings.

  • If you create a script containing only a mask & path, you should enter at least one dummy search string in the search string section of the editor. You can also override some of the values from the main window by entering new Search and Replace strings or new Path and Mask strings.

  • When a script is active, the Search, Replace, File Mask, and Path fields in the Search and Replace main window reflect the script in use. For example, given a script named, example.srs, which only has settings for a search string, the Search field in the main window will change to read "Use Script file: d:\example.srs". If example.srs also involves a replace string and a file mask, the Replace and File Mask fields will also change to read, "Use Script file: d:\example.srs".

  • See Special Script Prepend-Append Operators for information on operators that are available for prepend and append operations.

  • See Special Date Filter for information on the %%today%% setting for manually revised scripts the Min Date Filter= and Max Date Filter= switches in scripts.


Scripts - Script Editor


Scripts - Search and Replace Strings

Click on the graphic for help or see a text description of the fields. See Format of Script Files for information of script files themselves.


Scripts - Search and Replace Strings (Text)

Outlined here are the fields in the Search/Replace tab of the script editor. These are used to create one or more search (and replace) strings for a script. To quickly delete the existing script search/replace strings and insert those from the main dialog, press the CTRL key and click on the upper "Remove All" button.

Search String field: Enter the string to search for in this field. Selecting a line in the Search/Replace List will display the information for that line and allow you to edit it. When you are done with this field and with the settings for the Replace string, Case Sensitive, Regular Expression and Match Whole Word, click "Apply" to save the information to your script.

Search String Binary Mode button ( [image] ): Click this to activate the Binary Mode dialog to create searches that span multiple lines or involve special characters for the Search field. When you are done creating the string, "Binary mode -->>", is displayed in the search string area. If you want to double check your entry or make changes, click the button again.

Replace String field: Enter the replacement string in this field. Special Replacement Operators can also be used here. Selecting a line in the Search/Replace List will display the information for that line and allow you to edit it. When you are done with this field and with the settings for the Search string, Case Sensitive, Regular Expression and Match Whole Word, click "Apply" to save the information to your script.

Replace String Binary Mode button ( [image] ): The operation here parallels the Search String binary mode editor. Click this to activate the Binary Mode dialog to a multiple line and/or special character Replace String. When you are done creating the string, "Binary mode -->>" is displayed. To view the string later, click the button again.

Case Sensitive field: Check this to make the search case sensitive. Uncheck it if you want to search regardless of case. To save the information for the current row when you are done, click "Apply" (in the same group).

Match Whole Word: Check this field to search for the exact word or phrase specified (enclosed by whitespace). For example, if this option is on and you look for "Window", the program will find it in the phrase "...use the Window menu..." but not in the phrase "...Windows 95...". If this option is not checked, both occurrences will be found. To save the information for the current row when you are done, click Apply (in the same group). Match Whole word is not available when Regular Expression is checked.

Regular Expression: Check this to use a regular expression. Case sensitive and binary mode can be used in conjunction with this type of search. See Regular Expressions for more information on the syntax supported. To save the information for the current row when you are done, click "Apply" (in the same group).

Ignore Whitespace: Check this to use Ignore Whitespace mode. To save the setting for the current line, click the Search/Replace "Apply" Button. Ignore Whitespace is not available when Regular Expression is checked.

HTML Mode: Check this to use HTML Mode. Click the "Apply" button to save the setting for the current line. HTM Mode is not available when Regular Expression is checked.

Search/Replace List: The search/replace items currently in the script are listed in the lower section of the dialog. The checkboxes - [image] and [image] - determine whether that s/r string pair will be used. The default is that all s/r pairs are used. To disable an item, click on the box and uncheck it. To edit a specific s/r pair, highlight it in this list. The Search String and Replace String for the line will then be exposed and you can then modify or delete it as you wish.

Apply button for Search/Replace List: Click this button to save the information for the currently selected line.

Insert button for Search/Replace List: Click this button to insert a new Search/Replace line above the currently selected line. To quickly insert the current search/replace entries from the main dialog without deleting the other entries, hold CTRL and click on "Insert".

Remove button for Search/Replace List: Click this button to delete the information for the currently selected line.

Remove All button for Search/Replace List: Click this button to remove all the Search/Replace lines (to start a new script for example). To quickly delete the existing script search/replace strings and insert those from the main dialog, press the CTRL key as you click on this button.

Move Up button for Search/Replace List: Click this button to move the information for the currently selected line up by one line.

Move Down button for Search/Replace List: Click this button to move the information for the currently selected line down by one line.


Scripts - File Masks & Paths

Click on the graphic for more help or see a text description of the fields. See Format of Script Files for information of script files themselves.


Scripts - File Masks & Paths (Text)

Outlined here are the fields in Path/Mask tab of the script editor. These are used to create one or more file masks and path combinations for a script. To quickly delete the existing script mask/path settings and insert those from the main dialog, press the CTRL key and click on the lower "Remove All" button.

File Mask field: Enter 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 ZIPs as well as ordinary files in the path specified in the path field. See File Masks for more information.

File Mask Dialog button ( [image] ): Click this to activate the Include Exclude Files & Directories dialog. This dialog is used to help you generate complex mask expressions that will be inserted into the file mask field.

Path field: Enter the path where files to search reside. You can use Complex File Mask expressions to further specify which files in the path will be processed by the script. You can also use the Advance Script Options button or the Options button on the Search and Replace main window to establish Filters to further specify the files to be processed. To save the information for the current line, click "Apply" (in the same group).

Path Browse button ( [image] ): Click to select the path where files to search reside. The Select Path dialog will be displayed to allow you to visually select the path. If the Path field (described above) contains a valid path, it will be your starting path in the path browser. Otherwise, the current path will be used. To save the information for the current line, click "Apply" (in the same group).

Path/Mask List: The file mask/path items currently in the script are displayed here. To change a specific line, select it in this list. The information for the line will then be displayed and you can then modify or delete it as you wish.

Apply button for Path/Mask List: Click this button to save the information for the currently selected line.

Insert button for Path/Mask List: Click this button to save the information for the currently selected line. To quickly insert the current path/mask entries from the main dialog without deleting the other entries, hold CTRL and click on "Insert".

Remove button for Path/Mask List: Click this button to delete the information for the currently selected line.

Remove All button for Path/Mask List: Click this button to remove all the Path/Mask lines (to start a new script for example). To quickly delete the existing script mask/path settings and insert those from the main dialog, press the CTRL key as you click on this button.

Move Up button for Path/Mask List: Click this button to move the information for the currently selected row up by one row.

Move Down button for Path/Mask List: Click this button to move the information for the currently selected row down by one row.


Scripts - Advanced Script Settings (Text)

Advanced Script Settings are established in the Advanced tab of the script editor. These allow for precise control over the files to be processed and the program options functions in effect during the script. File selection for the script is determined first by the path and file mask fields in the Script Editor and then by the boolean Expression Evaluator in the "Process File When Expression is Non-Zero" field (also see below).

Advanced Script Settings also allow you to supply comment text to help you keep track of your scripts.

Note: Advanced Script Settings are intended for scripts run via batch files using command line switches. They are designed to be used with replacement prompting turned off. Please see Advanced Expressions and Replacement Operations for information about the behavior of replacement prompts when a complex expression is in effect and advice on debugging your expressions.

Details on the Advanced Script Settings Fields:

Script Description: A descriptive comment of your choice may be entered here.

Process File When Expression is Non-Zero: This field is the boolean "Expression Evaluator" which is used to determine which files among those that meet the path, file mask, and filter criteria are actually processed by your script. The variables in this field are labeled E1, E2 ... En, where n is the number of search/replace strings in your script. Under the default OR expression (e.g., E1 OR E2) all files that meet the path, file mask, and filter criteria are processed. Other combinations of operators and variables in the expression allows you to process only certain files within the domain of possible files according to your path and file mask criteria. When the result of the expression is non-zero, a file will be processed.

The field may contain: a) the AND OR NOT < > <= >+ = != + - * / operators, b) E1, E2, E3,... En to denote the search & replace string pairs in the script, c) numeric values denoting the number of replacement opportunities for a variable (e.g., E2 >= 1), d) comparisons of the numeric values of the number of replacement opportunities (e.g., E1 AND (E2 != (E3))), and, e) arithmetic expressions on the values of the En variables (e.g., (E1 + E2) = (+5)).

Important Note: When making replacements the 'Process File When Expression is Non-Zero' comes into play after all search hits have been accumulated. When making replacements you will receive replace confirmations (if confirmations are enabled) for all places where a search hit exists for a given search expression even though the 'Process File When Expression is Non-Zero' field may rule out that replace once all the search hits are collected. Do not be alarmed! This is for debugging your search terms. When you are satisfied that your search terms are finding what they should find you must answer 'Replace This' or 'Replace All' to replacement prompts in order for 'Process File When Expression is Non-Zero' to be applied properly. The expression is based on 'replacement opportunities'. If you rule out a replacement opportunity by answering 'No' to a replace confirmation you may affect the final assessment by the 'Process File When Expression is Non-Zero' file. Please see Expression Evaluator and Replacement Prompts for more detail. Also see Expression Evaluator for details.

Options Button: Opens an abbreviated Options Dialog you can use to specify settings for the script. The Options-General tab is not available here because those settings are not needed during scripted operations.

Use Program Options Checkbox: When checked, the script uses the Options in effect for Search & Replace. When unchecked, the script overrides the Options settings and uses changes you make via the Options Button to the left of this field. To remove all options from a script and use the current program settings instead, check this field.

Repeat Script: This is the Script Loop operator. This setting affects the entire script. The default value is 1. To repeat the entire script more than once, select a new value.

Search Subdirectories Checkbox: By default, scripts follow the "Search Subdirectories" settings on the Main Window. Check this box if you want your script to search subdirectories regardless of the setting in the Main Window. This field is dim if "Use Program Options" is checked.

Save As button: Click to save the created/modified script to disk.

Load button: Click to load a script from disk for editing or using Search, Search and Replace, Touch or File Find.

Use Script button: Click to use the script for Search, Search and Replace, Touch or File Find. You can override several of the script settings in the main window (see Scripts for details).

Cancel button: Exits the dialog without using the script settings. If you made changes to a script, you are asked whether you want to save the information. The ESC key also cancels.

Help Button: Activates F1 Help.


Scripts - Script File Operations

Outlined here are the buttons across the bottom of the script editor dialog.

Save As button: Click to save the created/modified script to disk.

Load button: Click to load a script from disk for editing or using Search, Search and Replace, Touch or File Find.

Use Script button: Click to use the script for Search, Search and Replace, Touch or File Find. You can override several of the script settings in the main window (see Scripts for details).

Cancel button: Exits the dialog without using the script settings. If you made changes to a script, you are asked whether you want to save the information. The ESC key also cancels.

Help Button: Activates F1 Help.


Scripts - Format of Script Files

Scripts are saved as ASCII files. The safest way to create a valid script is to use the Script dialog. As you gain experience you can modify/create scripts with your text editor, perhaps using an existing script as a model. Be sure to reload your script into the Script dialog if you edit it with an external editor.

A text counterpart to this section is installed with the program. The file name is 'ScriptInfo.txt'. Sample scripts are also installed with the program. The sample scripts end with the name extension, '.srs'.

The simplest script possible is a text file consisting of a search string(s) separated by blank lines or a search/replace string(s) on adjacent lines. See Simple Script for more information.

If you are running a script from the command line, add the /s switch to launch Search and Replace and automatically initiate a search. If your script involves a replace, use /r in your command line to initiate the replace.

Please note that if you specify linked script(s), follow-up scripts operate in the same mode as the script that launches them. For example, if the initial script is run as a search-only, scripts linked from the initial script are also search-only. If the initial script is run as a search-replace, linked scripts are search-replace.

A full script file using Advanced Script Settings is presented below. See Option Section Details for more information on the [Expression] and [Options] section.

Please scroll this screen to see other notes on script syntax.

[Script for Search and Replace]

This is an example script using alternate program options for the

script. The text you are reading here is the script comment added

via the Advanced Script Dialog.

NOTE: The script sections demarked by [ ] and the [Options]

switches must be entered in the order you see here. The first

line must be the bracketed 'Script for Search and Replace' tag

above. If you are not using Linked Scripts, the 'End of Search

and Replace Script' tag is the last line.

NOTE: It is not necessary to specify all the [Options] switches.

For version 3.9 and above, switches within the [Options]

section can be in any order. If a given Options switch is not

specified in a script, the settings last in effect for the

program will be used. In addition, the General Options settings

that are included in the 'SRDUMP file' method above are ignored

when the script is run in version 3.9+. For example, if your

script specifies a 'Default Viewer', the program ignores this

when you run the script. This preserves your default settings

for interactive use.

NOTE: Use the 'SRDUMP file' method to generate a script

that contains the program options currently in effect. You can

use SRDUMP.SRS as a template for developing other scripts

manually.

NOTE: The iteration switch, Script Loop= , must be added by editing

the script manually with your text editor.

Script Loop= must be the last entry in the [Options] section.

See F1 hlp topic - Scripts - Iteration Operator - for more info.

NOTE: See F1 hlp topic - Scripts - Linked Scripts - for information

on how to chain scripts. For version 3.4, follow-up scripts are

specified below the [End of Search and Replace Script] line in

a script. You must specify this manually, via your text editor.

[Expression]

E1 AND E2

[Options]

Search_subdir=0

Prompt_flag=0

One hit=0

Count Across Files=0

Replace Processing=0

Process Binary Files=1

Buffer Size=102400

Num Buffers To Process=0

Output_File=

Append to output file=0

Backup Path=D:\SRBACKUP

Write to Backup Dir=0

Keep file time stamp=0

Max Display Chars=128

Max Reg Expr=32767

Unzip Dir=C:\WINDOWS\TEMP

Show Progress Dialog=1

Before Hit=<

After Hit=>

Line Prefix=Line %3d -

Binary Prefix=Offset 0x%6lx -

Show_Files=1

Show Files Without Hits=1

Display Replace String=1

Display File Stats=1

Show File Date and Size=0

Reverse Filters=0

Min Size Filter=0

Max Size Filter=0

Min Date Filter=%%today-1%%

Max Date Filter=

Skip Files Mask=0

Ignore Attributes=55

Sort File Names=3

Sort Ascending=0

Script Loop=1

[Search] This comment added to a search line.

Search string #1

[Replace /b] This comment added to a replace line.

Replacement string #1

[Search /bix] See / switches for more info.

Search string #2

[Replace]

Replacement string #2

[Path]

c:\*.ini

[Path]

d:\work\*.txt

[End of Search and Replace Script]

c:\tools\sr\Linked Script1.srs

c:\tools\sr\Linked Script2.srs

Notes:

  • See 'SRDUMP file' for instructions on generating a script consisting of the current settings for the program. You can use that file as a template for other scripts.

  • The following tags must be at the beginning and end of the script: [Script for Search and Replace] and [End of Search and Replace Script].

  • Comment text must immediately follow the [Script for Search and Replace] section or after the closing ] bracket in the Search &/or Replace strings.

  • The order of section headings must follow that outlined above.

  • The [Options] section is not required. If you create a script using a text editor and wish to set only one or a few options, it is OK to enter only those specific options. Scripts saved via Search and Replace will have all options saved with the script.

  • Search strings can be entered on the next line after a [Search] tag. To enter the Regular Expression, Case Sensitive off (or Insensitive), Whole Word Only and Binary Mode, you must use the /x /i /w /b flags respectively. The flags are case insensitive. This is similar to the flags for Command Line Parameters .

  • Replace strings can be entered on the next line after a [Replace] tag. You can only use the /b flag for Binary Mode with this tag since all other tags are specified on the Search field.

  • Path and mask strings can be entered on the next line after a [Path] tag. No flags can be used with this tag. The mask string must be entered right after the path string and a \ character is expected between them. For example c:\*.ini will use Path C:\ and Mask *.ini. If you turn on the Search Subdirectories box on the main window, all INI files on the C: drive would be processed.

  • You can enter Search strings only, both Search and Replace strings, Path and mask strings only, or all the fields in a script. You can also override some of the values from the main window by entering new Search and Replace strings or new Path and Mask strings.

  • When a script is active, the Search, Replace, File Mask, and Path fields in the Search and Replace main window will change to reflect the script in use. For example, given a script named, example.srs, which only has settings for a search string, the Search field in the main window will change to read "Use Script file: d:\example.srs". If example.srs also involved a replace string and a file mask, the Replace and File Mask fields would also change to read, "Use Script file: d:\example.srs".


Scripts - Format of Script Files Options Section

Below is some detail on the items in the [Expression] and [Options] section of a script. Use this as a guide for manual edits.

It is not necessary to specify all switches in the [Options] section. For example, a sole [Options] item could be Prompt_flag=0.

With the exception of the Script Loop= switch, the [Options] switches for version 3.9 and above can be in any order. If you need to maintain backwards compatibility for use with older versions of Search and Replace, use the order below.

Script Item

Notes & GUI Counterpart

[Expression]

E1 AND E2

This section is optional. It is

created via the Advanced Dialog.

[Options]

Search_subdir=

0 = No; 1 = Yes. If this switch is not

specified, the current program setting

is used.

Prompt_flag=

Corresponds to Replace Prompts in

Options-Replace. 0 = Prompt on All; 1

= Prompt on Each File; 2 = No Prompts.

Current program setting is used if

this is not specified.

One hit=

Corresponds to 'Stop Processing After

First Hit In File' in Options-Search.

0 = No; 1 = Yes. Omit to use current

program setting.

Count Across Files=

This is for v 4.3+. %n>> and %n<<

counter replacements normally do not

reset with each file. Specify Count

Across Files=1 to cause the program to

reset with each new file instead of

sequencing across files. This switch

must be specified manually with a text

editor. The other choice is Count

Across Files=0, which is the default if

not specified.

Replace Processing=

For ver 4.4+. See Special Case Handling

for more information. The choices are:

Replace Processing=0 - No special effects.

This is the default if the switch

is omitted.

Replace Processing=1 - Capitalize words

during replaces.

Replace Processing=2 - Match Existing

letter case.

Process Binary Files=

For version 5.0+. Search and Replace normally searches any file that meets the file mask/path and filter criteria. If you specify Process Binary Files=0 the program will skip any file it determines is 'binary'. Note that depending your output settings, the file(s) will still be listed. But they will be shown as having no hits.

Buffer Size=

The size of the memory block (in bytes) used by the program when reading files can be adjusted using this switch. For most uses we suggest leaving this at default or omitting it entirely. The default is 102400. The lowest value permitted is Buffer Size= 1024.

Note: Buffer Size may have indirect effect on Max Reg Expr= behavior. If Buffer Size= is set lower than Max Reg Expr= by limiting the size of blocks searched the effective Max Reg Expr= is limited to Buffer Size. The default Max Reg Expr=32767 bytes. If your search requires this span as a minimum, Buffer Size should be at least Buffer Size=32767.

Num Buffers To Process=

Use this switch to limit the number of blocks to process in each file. The default Num Buffers To Process=0 means all blocks, or the entire file. This switch can be used in conjunction with the Buffer Size= switch above. For example, to search only the first 26,000 bytes of all files specify:

Buffer Size=26000

Num Buffers To Process=1

Note: If One hit=1 is specified, that switch takes precedence if a hit is found within the number of blocks specified.

Output_File=

Options-Output. Omit or leave blank if none is to be used.

Append to output file=0

Corresponds to 'Append to Output File'

in Options-Output. 0 = No; 1 = Yes.

Omit to use current program setting.

Max Reg Expr=

Options-Search. Determines the maximum

number of characters spanned by regular

expression terms. The range is 50 to

32767.

Max Display Chars=

Options|Search. Determines the number of

characters to list on each hit line. The

range is 128 to 4069.

Backup Path=

Options-Replace. If this switch is

included but no file is specified, no

backup path will be used. If not

specified, the program default is

used.

Write to Backup Dir=

Options-Replace. 0 = No; 1 = Yes

Unzip Dir=

Options-Search.

Keep file time stamp=

Corresponds to 'Do not change file

date/time' in Options-Replace. 0 = No;

1 = Yes. Omit to use current program

setting.

Show Progress Dialog=

Options-Search. Determines whether or not

to display the progress meter.

Before Hit=

After Hit=

Options-Output. Characters to go before

and after the search hit.

Show_Files=

Corresponds to 'Display First Hit

Line' in Options-Output. 0 = No; 1 =

Yes. Current program setting is used

if this is not specified.

Show Files Without Hits=

Corresponds to 'Display Files Without

Hits' in Options-Output. 0 = No; 1 =

Yes. Current program setting is used

if this is not specified.

Display Replace String=

Corresponds to 'Display Replace

String' in Options-Output. 0 = No; 1 =

Yes. Current program setting is used

if this is not specified.

Display File Stats=

Corresponds to 'Display Number of Hits

in File' in Options-Output. 0 = No; 1

= Yes. Current program setting is used

if this is not specified.

Reverse Filters=0

Corresponds to the 'Reverse Filter'

checkbox in Options-Filter. 0= No; 1 =

Yes. Omit to use current program

setting. See Skip Files Mask and

Ignore Attributes below for more info.

Min Size Filter=

Max Size Filter=

Min Date Filter=

Max Date Filter=

Options-Filter. Omit some or all to

use current program setting. See

Special Date Filter for information on

a special, %%today%% switch.

Skip Files Mask=0

Ignore Attributes=55

The default values for these two

settings are listed here. These values

are related to the Attributes

checkboxes in Options-Filters. The

number of possible values, in

conjunction with the Reverse Filters

switch above, is extensive and

difficult to explain. Most users will

not have any setting here. If you do

need a special setting, experiment

interactively with Options-Filters

dialog and some file searches. When

you are satisfied, generate an

'SRDUMP.SRS' file and copy the switch

settings into your production script.

You can also write us for help at

support@funduc.com

Sort File Names=

Corresponds to the 'Sort Results By'

combo list in Options-Search. The

values are: 0 = Unsorted, 1 = File

Name, 2 = File Extension, 3 = File

Date/Time, 4 = File Size, 5 = File

Path. Omit to use current program

setting.

Sort Ascending=

Corresponds to the Sort Ascending

checkbox in Options-Search. 0 =

Descending, 1 = Ascending. Omit to use

current program setting.

Line Prefix=

Binary Prefix=

These two switches for for v 4.3+ only.

They are 'read-only' settings for users

who create/edit scripts manually, with

a text editor. If you save a script

with the script editor these switches

will be stripped out. These work with

the English only. Do not use if you are

using a language module. See Line Prefix Switches for more information.

Script Loop=

Script Iteration Counter. This must be

entered manually. It must be the last

entry in the [Options] section. Also see

Script Repeat Action for information on

how to repeat specific search/replace

strings.


Script Comments

Comments may be used in two places in a script:

1. An overall comment - Script Description - that is entered at the top of the script via the Script-Advanced tab of the script editor.

2. Comments for each Search/Replace string that can be entered by clicking on the Comment button in the Script-Search/Replace tab.

The Comment dialog is also used to control whether or not a search/replace is repeated. See Scripts Repeat Action for more information.

Search/Replace String Comment Dialog

See Format of Script Files for more information.


Script Repeat Action

Search/Replace String Comment Dialog

The Script Editor Comment dialog is used to specify comments for a search/replace string pair and/or specify a value for the number of times to repeat a search/replace action.

To activate the Script Comment dialog for a search/replace, click on the Comment field in the Script-Search/Replace tab.

To repeat a search/replace action, enter a value in the Repeat Action field. Repeat Action values can vary across search/replace actions if your script has multiple search/replace strings.

The default value is 1. If you edit your script manually with a text editor DO NOT specify a value of 0. If you want to disable a search/replace, uncheck the checkbox to the left of that search/replace entry in the program script editor or use the /g switch if you are making manual edits using a text editor.

Notes:

  • See Format of Script Files for information about script syntax.

  • An overall comment - Script Description - that is entered at the top of the script via the Script-Advanced tab of the script editor.


Scripts - Format of Script Files (/ switches)

If you examine some of your Search and Replace script in your text editor you may be curious what the switches are with in the [Search] and [Replace] tags. The possible switches are:

Tags and Possible Switches

[Search] Tag

/i = Case Insensitive

/x = Regular Expression Mode

/b = Binary Mode

/w = Whole Word Mode

/h = Ignore Whitespace Mode

/t = HTML Mode

/r? = Repeat ? number of times

/g = Do not use this s/r pair
(See below)

[Replace] Tag

/b = Binary Mode

Important Notes:

  • All switches cannot be used at the same time in the [Search] section as not all modes are compatible with each other. For example, you cannot use /i and /t at the same time. The built-in script editor will prevent incompatible tags from being used at the same time so construct your scripts using that.

  • See Script Repeat Action for information on the /r switch. The value specified must be 1 or above.

  • The / character can appear only once. For example, Case Insensitive Regular Expression would be /ix

  • Order does matter. Again, use the built in script editor to set up your initial script.

  • The /g switch is related to the [image] and [image] checkboxes in the Search/Replace strings section of the script editor. /g means "disable this s/r pair" ( [image]).


Scripts - Iteration Operator

Script Loop=

Search and Replace v3.2+ has a special script operator, Script Loop=x, to permit a script to be repeated x number of times.

This operator is useful for situations where a search/replace string might not make all possible replacements on the first pass. This can happen, for example, when a * or *[] search operator in your overall regular expression search term spans text that includes a string component that you wish to have replacements done on. This can also happen if a replacement somehow impacts the next instance of a string that would be found by the search term.

Non-Regular Expression search/replaces would likely not be affected in this way.

The value can be larger than necessary. If no more search hits are found the program will stop the iterations.

Usage:

Script Loop=x

where x = the number of times to repeat the script. Search and Replace does not have an internal limit for the maximum value. Use a value of -1 to cause the script to repeat indefinitely (not recommended). Press the ESC key to abort a running script.

The Script Loop= setting must be added manually, via an external text editor.

This switch must be the last item in the [Options] section of the script.

Be sure to reload the script into Search and Replace if are using that same script in Search and Replace and made a manual edit with an external editor.

See Scripts - Format of Script files for more detail. Here is a small sample script:

[Script for Search and Replace]
[Options]
Script Loop=5
[Search /ix]
^\r\n\r\n\r\n
[Replace]
\r\n\r\n
[End of Search and Replace Script]


Scripts - Format of Script Files (Simple)

The simplest script possible is a text file consisting of a search string(s) separated by blank lines or a search/replace string(s) on adjacent lines.

For example, when a text file consisting of:

mailto:

<table

is loaded in the script editor, the strings "mailto:" and "<table" would be entered as two separate search strings.

When a text file consisting of:

Windows 31
Windows 95
Windows NT
Windows 2000

is loaded in the script editor, the search/replace combos of "Windows 31" / "Windows 95" and "Windows NT" / "Windows 2000" would be entered as two separate pairs in the search string and replace string fields.

See Import Search/Replace Strings for an additional example.


Scripts - SRDUMP.SRS File

To create a script file containing the current options settings, GUI search/replace strings, and GUI file mask/path criteria, do the following:

1. Hold the CTRL key and click on the Scripts toolbar button with your mouse.

2. The above will cause the script editor to open. Close the editor.

3. A file named 'SRDUMP.SRS' is generated in the 'Program Work Path' by Step 1. Unless you have taken special steps for a network installation, this is generally the same file path that the Search and Replace executable is (sr32.exe) is installed in. C:\Tools\SR is the default program installation path.

4. Use your file manager to copy/rename SRDUMP.SRS to another file.

You can use this file as a template for developing other scripts. This file is also useful for showing you the correct order of switches in the [Options] section.

Scripts are standard .txt files that you can open with your text editor. If you are also working on a given script in the script editor , be sure to reload it after editing it with an external editor.


Scripts - Linked Scripts

Search and Replace version 3.4+ has a special script operator that allows two or more scripts to be 'chained' in succession. The same effect is achieved in earlier versions by using .bat/.cmd files to launch sequential instances of the program, each instance to run a different script. The Script Link function in version 3.4 can be useful to those who are uncomfortable with .bat/.cmd files.

The syntax for linking scripts is modeled at the bottom of the script below. For version 3.4 you must create/edit scripts that contain Script Link instructions with your text editor. The version 3.4 internal Script Editor respects existing Script Link references but you cannot create them via the Script Editor.

Please read through this entire section before you use Script Linking for the first time!

Example Script with Script Link References

[Script for Search and Replace]
[Search /i]
something
[Replace]
something
[Path]
D:\TEST\somefile.txt
[End of Search and Replace Script]
D:\TEST\Script2.srs
D:\TEST\Script3.srs
D:\TEST\Script4.srs
...(Additional scripts)...
D:\TEST\ScriptLast.srs

Script Link references are placed at the bottom of a script file, below the [End of Search and Replace Script] tag. The format is to specify the full path name to a script file.

Notes:

  • Linked scripts perform the same 'search-only' vs. 'search/replace' operation as that in effect for script that launches them. For example, if the initial script containing link references to other script(s) is launched as a search-only operation, the chained scripts will also perform a search-only. Conversely, if the initial script is launched as an search-replace, the other scripts will also perform a search-replace. See below for usage suggestions.

  • Linked Scripts are intended for scripts edited via an external editor and then launched from the command line (&/or .bat/.cmd files). Alternative, you can launch the initial script from the Favorites Menu. Scripts loaded into the Script Editor and then launched into the main Search and Replace program will also chain scripts if that script contains script link references. However, our intend use for linked scripts is via the command line or Favorites.

  • Avoid nested Linked Script references!! For example, if script1.srs chains to script2.srs, do not place any linked script references in script2.srs.

  • Individually debug all scripts in advance. There is no way to 'pause' a series of linked scripts.

  • Scripts can have a mixture of replace confirmations vs. not. However, be aware of the consequences to any later operations if you chose to skip a replace.

  • If you prefer to use the Script Editor for your editing chores, consider using 'dummy scripts' that would not need any editing to launch your linked scripts. See below for usage suggestions.

Usage Suggestions

Case 1 - Linking a mixture of Search-Only and Search-Replace operations

Create separate initial scripts for each type of operation. For example, if you wish to perform some replaces and then a search, chain your search-replace scripts and then separately launch your search-only script. A .bat command line for this might be

start /w c:\tools\sr\sr32.exe /r /c"c:\tools\sr\scripts\replaces.srs" /q
start /w c:\tools\sr\sr32.exe /s /c"c:\tools\sr\scripts\search.srs" /q

The script 'c:\tools\sr\scripts\replaces.srs' might can contain one or more links to other search-replace operation scripts. Do not make a mistake and put a script link reference to a script intended as a search-only script in 'replaces.srs' - the program will perform a replace instead because you launched that script via a search-replace.

Case 2 - Using 'Launching' Scripts'

You can use scripts that accomplish nothing meaningful as launching points for linking scripts. Let's say you have a series of complex scripts the require debugging and you want to easily test these in sequence. Instead of specifying the linked script references in a main script, create one or more scripts whose sole purpose is to launch your main scripts.

Since all scripts must have some kind of valid operation, your 'launching' scripts must contain valid search-replace strings. However, you can use 'dummy' strings that would never be found in any file. Likewise, you can use a path/mask that refers to a file that does not exist on your drive.

Example:

[Script for Search and Replace]
[Search]
bbbbbbbbbb
[Replace]
bbbbbbbbbb
[Path]
D:\TEST\this_file_does_not_exist.txt
[End of Search and Replace Script]
D:\TEST\Script2.srs
D:\TEST\Script3.srs

The script above accomplishes nothing - even if the file, 'this_file_does_not_exist.txt',. is present on your drive, if launched as a search-replace, the operation itself changes nothing because the strings are identical.


Scripts - Special Date Filter

A special string, %%today%%, is available for the
Min Date Filter=
Max Date Filter=
switches in manually edited Search and Replace scripts.

%%today%% uses the current computer date for the respective filter setting. You can add or subtract days by specifying a +/- value before the ending %%.Examples: %%today-5%% uses a date filter of the current date minus 5 days; %%today+1%% adds one day to the current date.

You can use forms of %%today%% in both switches. Example:
Min Date Filter=%%today+5%%
Max Date Filter=%%today%%

Important Notes:

  • %today%% can only be specified by editing your script manually with a text editor. The program graphical interface currently does respect the string, %%today%%. If you load a script that uses %%today%% and look at the script in the internal script editor you will see the actual calculated dates.

  • If you revise a script via the script editor the save function will probably overwrite %%today%% specifications with the actual calculated dates. Please use care and keep a backup of your original script. You may have to manually revise it again with your text editor.

  • %today%% can be used in the GUI Options|Filters dialog. The program will convert your entry to an actual date when you close the dialog.


Apply Script Function

The Apply Script function, accessible from the Binary Mode dialog, allows you to transform the search &/or replace strings into something else by applying a script to them in advance of a later operation. This allows you, for example, to more easily handle the plain text conversions needed when dealing with RTF, Unicode, or html documents. Different scripts may be separately applied to the search and replace strings.

To use the Apply Script function you must first develop a script to process the search &/or replace strings. The scripts are standard Search and Replace scripts with the qualification that it is not necessary to supply a [Path] entry. They may be created via the Script Dialog or manually using a text editor.

Note: Press CTRL+Binary Mode button to quickly insert the current search/replace string into the respective binary mode dialog.

Three example uses of the Apply Script are available:


Scripts - Advanced Script Settings

Click on the graphic for more help or see a text description of the fields. See Format of Script Files for information of script files themselves.


Scripts - Graphic View of Advanced Settings


Scripts - Expression Evaluator & Replacement Prompts

Scripts - Expression Evaluator

Described below is a general introduction about the Expression Evaluator, some specific notes, and some basic examples.

Introduction:

Expression Evaluator Field

The "Expression Evaluator" is the "Process file when expression is non-zero" field in the Advanced Script Settings dialog. The expression in this field determines which files among those meeting the file mask, path, and filter criteria are ultimately processed by your script. If the result of the expression is 1 for a file, that file will be processed further. Under the default OR expression, all files meeting the file mask, path, and filter criteria are processed because the value of the expression would be 1 for each file - If a search string makes a hit, that search (or replace) will occur. Other combinations of operators and variables in the expression would allow you to process only certain files within the domain of possible files according to your file masks, path, & filters.

The variables E1, E2, ... En reference the search/replace string pairs in the script. A script with 3 strings would have E1, E2, & E3 available.

The valid operators are: AND OR NOT < > <= >= >+ = != + - * /

The default expression is an OR statement, e.g., E1 OR E2 OR E3

Numeric values may be used in conjunction with variables to denote the number of replacement opportunities in a file. For example, the expression

E1 AND (E2 = 4)

would process only those files where the first search & replace pair could occur one (or more) times and the second search & replace pair could occur exactly 4 times.

Notes on the Expression Evaluator:

  • Advanced Script Settings are intended for scripts run via batch files using the command line switches for Search and Replace. They are designed to be used with replacement prompting turned off. Be sure to read the help section on Advanced Expressions and Replacement Operations for information about the behavior of replacement prompts when a complex expression is in effect and advice on debugging your expressions.

  • Unary versions of the + and - operators must be enclosed in parentheses, e.g., (-1).

  • You can compare one string to another, e.g.,
        E1 AND NOT(E2 != (E3)))
        E1 AND NOT(E2=1 or (E3 != (-1)))

  • E1 and (E1 >= 1) are equivalent. Conversely, NOT E1 and (E1 = 0) are equivalent.

  • Operators are parsed in the following order:
        1) (
        2) * /
        3) + -
        4) = != > >= < <=
        5) NOT
        6) AND
        7) OR

  • Search and Replace checks the expression syntax for unbalanced parentheses, invalid variables, and missing or incorrect operators. Upon errors involving invalid variables, the program will change the expression to an OR statement matching the number of search strings in the script. For example, say you create a script manually that contains 2 search strings and the expression E1 AND (E2 != E3). When the script is loaded into Search and Replace, the program will notify you of the error involving variable E3 (it should not be present in a 2 string script) and the expression will be changed to E1 OR E2.

  • By using the "Move Up" and "Move Down" buttons on the main Script Editor dialog to rearrange the search & replace strings, the strings associated with the En variables in the Expression Evaluator will change. Depending on your expression, rearranging strings may be more convenient than rewriting the expression itself.

Some Basic Expression Evaluator Examples:

Note: These examples assume that Replacement Prompts are disabled OR no "Skip" replacements are allowed if Replace Prompts are turned on. See Advanced Expressions and Replacement Operations for more information about the possible influence of "Skip(s)" on expressions involving numeric values.

FILE CONTENTS
File 1 | File 2 | File 3
JILL JACK JOHN | JACK CAROL | JILL JACK JOHN
Script Search Strings: E1 = JILL E2 = JACK E3 = JOHN E4 = CAROL
Expression Evaluator: E2 AND E4
Files That Would Be Processed: FILE 2

FILE CONTENTS

File 1

File 2

File 3

JILL
JACK
JOHN

JACK
CAROL

JILL
JACK
JOHN

Script Search Strings:

E1 = JILL
E2 = JACK
E3 = JOHN
E4 = CAROL

Expression Evaluator: E1 AND E4

Files That Would Be Processed: None

FILE CONTENTS
File 1 | File 2 | File 3
12/18/94 Page 95 www.funduc.com | 12/01/95 12/15/95 | 12/19/95 www.funduc.com
Script Search Strings: (Note: E2 is a Regular Expression) E1 = 12 E2 = /*[0-9]/ E3 = 95 E4 = www.funduc.com
Expression Evaluator: E1 AND E2 AND ((E3 >= 2 OR E4)
Files That Would Be Processed: FILE2 FILE3


Scripts - Expression Evaluator & Replacement Prompts

Advanced Script Settings and the Expression Evaluator are designed to used for scripts run via batch files using command line switches. The advanced script functions are geared toward complex operators that are run with replacement prompts turned off for the script via the Options button on the Advanced Script Settings dialog.

It is OK to use Replacement Prompts during advanced operations. However, you should note that the behavior of replacement prompts during search & replace operations involving complex expressions differs from those using a standard OR expression such as E1 OR E2.

When making replacements the Expression Evaluator is applied after all the search hits and 'replacement opportunities' for the entire operation are accumulated. Please keep the following in mind when making replacements and/or testing your expressions:

First, when replacement prompts are on, prompts are offered for search hits in every file meeting the file mask, path, and filter criteria, even though only some of those files might satisfy the criteria in the Expression Evaluator . Responding affirmatively to replacement confirmations in files that do not satisfy the expression will have no effect on those files. Regardless of how you respond to replacement confirmation prompts, replacements take place only in files that actually satisfy the expression!

Second, if you have replacement prompts enabled and respond "Skip" to a replacement that initially satisfies your expression, the "Skip" may influence the result of your expression. Number values in expressions are based on the number of search & replace opportunities in a file. Since a "Skip" eliminates one replacement opportunity, "Skip(s)" may impact expressions that make use of number values. For example, given the expression (E1 >= 2) and a file having exactly 2 search & replace opportunities. A manual "Skip" in response to either of the replacement prompts eliminates 1 search & replace opportunity. The file would therefore no longer satisfy the expression (E1 >= 2). This in turn means that no replacements would be made, even if you respond "Replace This" to the other prompt.

In some cases you may wish to enable replacement prompts in order to capitalize on the above behavior as this provides a way to have 'on the fly' control over your expressions.

Regarding debugging expressions, you should note that search-only operations report hits only in files that actually satisfy the expression. Therefore, to debug your script in advance of a search & replace operation and identify the specific files that will be selected by your expression, run a search-only operation. Another debugging tactic is to intentionally run a search & replace operation with confirmations set to "Prompt on all". This allows you to see all search/replace strings in-context in all files.

The table below outlines these characteristics:

REPLACEMENT PROMPTS & ADVANCED SCRIPT SETTINGS
Given the following: |  |
 | Contents of File #1: | 12/18/94 Page 12
 | Contents of File #2: | 12/19/95 www.funduc.com
 | Script Search Strings: | E1 = 12 E2 = Funduc
 | Expression Evaluator: | E1 AND E2
Results of the following scenarios would be:
 | Operation | Results
 | Search-Only: | The strings "12" and "funduc" would be reported in File #2 only.
 | Unprompted Search & Replace: | Replacements would be made in File #2 only.
 | Prompted Search & Replace: (Where user selects "Replace This" in each instance) | You would be prompted to replace the "12" in File #1 and "12" & "funduc" in File #2. Even if you answer "Replace This" to the "12" in File #1, File #1 would not be modified because it does not satisfy the Expression, (E1 AND E2). File #2 would be modified because you allowed all replacements to occur in File #2.
 | Prompted Search & Replace: (Where user selects "Skip" to either of the prompts for File #2) | No replacements would occur in File #1 (as above). No replacements would occur in File #2 because a skip in response to either prompt for File #2 means it no longer satisfies the expression (E1 AND E2).


Scripts - Import A List of Search/Replace Strings

To import use a list of strings as search/replace pairs in a script:

1. Create your list of search/replace string "pairs" in a text editor. Each string should be on a separate line, separated by a DOS carriage return. The pairs should be balanced such that there should be a replace string (or a blank line) corresponding to each search string. One check on your file is that the number of lines should be an even number. For convenience later on, consider naming the file with the extension .srs.

2. Open the Script Editor.

3. Click on "Load".

4. Navigate to the file you created in Step 1. The dialog defaults to the file name extension .srs. If you used another extension in Step 1, either manually type in the complete path to the file or change the initial file name filed to *.* (or another wild card) before navigating paths.

5. Click on "Open" after you have located the file..

6. The strings will be inserted into the Script dialog.

7. After reviewing the entries, click on "Use Script".

8. In the Search and Replace main screen, enter a mask and path and perform your operation.

Example:

The file "words.txt" consists of:

Windows 31
Windows 95
Windows NT
Windows 2000

When this is imported into the Script editor, the search/replace pairs would be:

Search: Windows 31
Search: Windows NT

Replace: Windows 95
Replace: Windows 2000

Example:

The file "words.txt" consists of:

oil seal
joint l'étanchéité à l'huile
KV6 gasoline

drive gear
pignon d'entrainement

When this is imported into the Script editor, the search/replace pairs would be:

Search: oil seal
Search: KV6 gasoline
Search: drive gear

Replace: joint l'étanchéité à l'huile
Replace: (Nothing - the string would be deleted)
Replace: pignon d'entrainement


Apply Script Function - HTML Example

Note: This example is provided for compatibility with earlier versions of Search and Replace. Users of version 3.2+ should make use of HTML Mode. When HTML Mode is active, Search and Replace automatically handles html special characters.

This example of the Apply Script function shows how the function may be used to handle plain text equivalents of special html characters. For example, the "&" character is typically represented as "&amp;" in raw html code. A search string of "Search & Replace©" may not make any hits on a scan of html files because the actual html code might be "Search &amp; Replace&copy;". The Apply Script function can be used to process the search string itself to quickly change "&" to "&amp;" and to "©" to "&copy;" before doing the search.

Steps

1. Begin by creating a script to perform the transforms using the Script Dialog or manually, using a text editor. A simple html conversion script for "&" and "©" is:

[Script for Search and Replace]

[Search]

&

[Replace]

&amp;

[Search]

©
[Replace]

&copy;

[End of Search and Replace Script]

This script can be any name. The name, "html tranform example.srs", will be used here.

2. To use html tranform example.srs in the Apply Script function, open the Binary Mode dialog and enter the string "Search & Replace©" (no quotes) into the dialog.

3. Click the Apply Script button, navigate to where html tranform example.srs is saved, and select it.

4. Click the "Open" button. html tranform example.srs will operate on the search (or replace) string and "Search & Replace©" and it will be changed to "Search &amp; Replace&copy;"

5 Click the OK button to use the transformed string to conduct your primary search (or replace).

Also see: [RTF Example] [Reg Exp Reserved Characters Example] [Apply Script Function Overview]


Apply Script Function - RTF Example

This example of the Apply Script function shows how the function may be used to handle plain text equivalents of upper ascii characters in rtf documents. If you were to search an rtf file for the characters "ä" or "ü" there would either be no search hits because these characters are coded as "\'e4" and "\'fc" (no quotes) in rtf. Conversely, a direct replace involving "ä" or "ü" would likely corrupt the rtf. The Apply Script function can be used to process the search (or replace) string to quickly change instances of "ä" or "ü" to their rtf counterparts.

Steps

1. Begin by creating a script to perform the transforms using the Script Dialog or manually, using a text editor. A simple conversion script for "ä" and "ü" is:

[Script for Search and Replace]

Comment: Double \\ is needed because \ is a Search

and Replace reserved character. In the actual RTF

document, ä is coded with as \'e4.and ü is coded as \'fc

[Search /i]

ä

[Replace]

\\'e4

[Search /i]

ü

[Replace]

\\'fc

[End of Search and Replace Script]

This script can be any name. The name, "rtf tranform example.srs", will be used here.

2. To use rtf tranform example.srs in the Apply Script function, open the Binary Mode dialog and enter the string "für komplexe oder häufig" (no quotes) into the dialog.

3. Click the Apply Script button, navigate to where rtf tranform example.srs is saved, and select it.

4. Click the "Open" button. rtf tranform example.srs will operate on the search (or replace) string and "für komplexe oder häufig" will be changed to "f\\'fcr komplexe oder h\\'e4ufig"

5. Click the OK button to use the transformed string to conduct your primary search (or replace).

Also see: [HTML Example] [Reg Exp Reserved Characters Example] [Apply Script Function Overview]


Apply Script Function - Regular Expressions Reserved Characters Example

Two transformational scripts, suitable for the Apply Script function, are included with the distribution of Search and Replace.

srch_re.srs can be used to change the reserved characters for regular expression search to their literal counterparts. For example, if you use a search term involving the string "c:\windows\system" in a regular expression the "\" characters must be doubled to denote the literal. srch_re.srs can be used to accomplish this.

repl_re.srs can be used to change the reserved characters for a regular expression replace to their literal counterparts. For example, in a regular expression replacement the "%" character normally denotes the %n operator. A replacement involving, say, "100%" might cause problems unless "100\%" is used in the replace term. repl_re.srs can be used to accomplish this.

Also see: [HTML Example] [RTF Example] [Apply Script Function Overview]


Command Line Parameters

Search and Replace Command Line Parameters

The command -line parameters are below.

Notes:

  • Search and Replace has many Options settings. As you review the available switches below please note that not all aspects of the program have a counterpart command line switch. The last program default in effect when the program was run will be used for settings that do not have a command line switch. If you need to control various options from the command line we suggest using a script. If you are using the build in script editor, the 'Options' button in the Advanced Tab can be used to specify the settings you need.

  • Very Important: If you are launching a script via the /c switch, add /s to launch Search and Replace and automatically initiate a search. If your script involves a replace, use /r in your command line to initiate the replace. Also see important notes concerning the operation in effect for Linked Scripts when launched from the command line.

  • The flags below can be upper or lower case.

  • The /i /x /d /w flags can be used separately or together in any order.

  • Do not leave spaces between switches that reference a file or path and the path specification.

  • Surround paths that have spaces with " characters.

  • To run the program in a minimized state and with no interface, use /u. See Minimized Mode.

  • We recommend using the Windows, 'start /w' launcher when you more than a single program instance defined in a .bat/.cmd file. See your Windows F1 hlp or type 'start /?' from a MSDOS box for more information on the 'start' command.

Some example command lines are:

SR32 /Oc:\dump.txt /SWindows /Pc:\windows\*.ini
SR32 /I /D /Oc:\dump.txt /SWindows /Pc:\windows\*.ini
SR32 /c"c:\scripts\main.srs" /r /q

Search and Replace Command Line Switches
/b | Backup path, e.g., /Bc:\temp\srbackup. See Replace Options
/i | Case Insensitive. Note that this option is the reverse of what the user interface shows. If not specified, Case Sensitive is assumed.
/x | Regular Expression. If not specified, it is assumed off. If you want to search for ' binary ' characters, specify /x.
/w | Match Whole Word (ignored if Regular Expression is used). If not specified, it is assumed off.
/sstring | Search String to use. This automatically starts a Search. If the string contains spaces or / characters, enclose it in double quotes as with the /r switch above. If the string contains " characters, use the \ character to denote the literal. For example, if your search string contains both quotes and a space, as in "Windows 95", you would use, SR32 /S"\"Windows 95\"" Note: To do a File Find from the command line, specify /s but supply no string.
/rstring | Perform a replace. This can be used either with scripts via /c switch (see below) or by itself with a replace string. If the string contains spaces or / characters, enclose it in double quotes as in /s below. If the string contains " characters, use the \ character to denote the literal. For example, if your replace string contains both quotes and a space, as in "Windows 98", you would use, /r"\"Windows 98\""
/d | Search Subdirectories. If not specified, it is assumed off.
/pC:\*.ini;*.txt | Path to search with mask(s) appended after the \. If no path or masks are specified, the last program default is used. The /p switch command line parameter accepts partial paths, including .. characters, e.g., /Pc:file.txt or /Ppfile.txt or /P..\test\file.txt or /P\file.txt.
/oresults.txt | Output file to send the search results to. If not specified, the last program default is used (this is specified in the Options dialog ).
/cscript.srs | Script file to use. Use /s to initiate a search. If the script involves a replace, use /r to initiate a replace.
/n | "No Prompts". Works only with /r. Note: This resets program options so you should manually restore prompts settings after using /n (see Options dialog ).
/t | Perform a Touch on the files specified. You can specify a date/time stamp or use the current date/time (default). For the 32-bit version, the user's date format is used and the HH:MM:SSam/pm format is used for time. For the 16-bit version, the same time format is used but the MM/DD/YY or MM/DD/YYYY format is used for date. The Touch dialog is only displayed if the date/time stamp passed on the command line is in the wrong format. The date & time MUST be enclosed in double quotes to work properly, e.g., SR32 /pc:\work\*.* /t"01/01/00 1:00:00am".
/u | Disables the user interface. Use this to run the program 'silently'. There will be no Taskbar entry. For no user interface during replaces, disable replace confirmations with /n or the 'Prompt_flag=2' setting in your script . Note: If you also don't want error messages about file locking or replacements in binary files, use Quiet Mode in Options|Genaral .
/q | Quit after operation. The Search & Replace window will close after the operation is completed.


Command Line - Binary Mode

If you need to preform 'binary' search/replaces from the command line the recommended tactic is to use a script. If this is not possible, use the /X command line switch and enter the binary code using the format in the List of Binary Codes.


Minimized Mode

To run Search and Replace from the command line in a 'quiet' state, so there in graphical user interface, use the /u command line switch.

Use caution when using this switch. The progress meter is displayed not and the program is is not even listed on the windows task bar. The only way you will be able to see the process is from the Task Manager or your NT/2000 administrative tools.


Boolean Expressions

There are several ways to make use of Boolean Expressions.

1. Direct Search Expression: The boolean symbols '&', '|', and '~' which stand for 'AND', 'OR', and 'NOT' can be used directly in the Search For: field in the main dialog. To use this functionality, disable Regular Expression, HTML mode, and Ignore Whitespace Mode if they are on and enable Whole Word mode. For example, to find files that contain the words 'this' and 'that', use (don't include the S: part):
S: this&that
See Direct Boolean Expressions for more information.

2. Regular Expressions *[] Operator: The *[] expression, which matches all characters and spans lines, can function like an 'and' operator of sorts. For example, to search for Susan and Bill in the same file you might use the regular expression search term
S: Susan*[]Bill
This is not very elegant of course.

3. Regular Expressions | Operator: The regular expression 'or' operator is also available. Example:
S: (Susan|Bill)
This can also be used in more complex expressions -
S: (Susan|Bill)*[](Susan|Bill)
Overlapping search hits may be a problem with the above so it is best that you have some familiarity with your files before using the above in replaces.

4. Regular Expressions ! Operator: The regular expression 'not' operator is somewhat more elegant than the above. By using an empty ! expression, !(), you can cause the program to do 'and' searches. For example,
S: DDX_Text*!()m_strSearchExpr
would find
DDX_Text(pDX, IDC_SEARCH_EXP_ED, m_strSearchExpr);
but not
DDX_Text(pDX, IDC_REPLACE_EXP_ED, m_strReplaceExpr);

5. Scripts Boolean Expression Evaluator: The 'Process file when expression is non-zero' field in the Advanced tab of the Script Dialog lets you make choices about which file(s) will be processed by a script. Search terms in the script are referenced by the E1, E2, ... En... variables, where n is the number of search terms in your script. The default expression is an 'OR' expression. If you are using anything other than an 'OR' expression be sure to review the section on Expression Evaluator and Replacement Prompts. When making replacements the program offers confirmations (if replace confirmations are enabled) for all places where a search hit exists. This is for debugging purposes. Expression Evaluator and Replacement Prompts. provides more detail about this.

Note: Also see Search Replace Current Files for another form of 'boolean' functioning. Search and Replace has special keyboard shortcuts to perform follow-up operations on only the files listed in the current Search Results list.


Direct Boolean Expressions

The boolean symbols '&', '|', and '~' which stand for 'AND', 'OR', and 'NOT' can be used directly in the Search For: field in the main dialog.

To use this function, disable Regular Expression, HTML mode, and Ignore Whitespace Mode if they are on and enable Whole Word mode. You can do this from the toolbar buttons or the Flags Menu. Case Sensitive can be on or not.

Notes:

  • Do not use the words 'AND', 'OR', or 'NOT'. Use the '&', '|', and '~' symbols.

  • Terms may be combined using ( ) characters.

  • ~ terms should come last and should be surrounded by ( ) characters. In most cases you should surround the first part of your search with ( ) as well. See the example below.

  • Replacements can be done if you like. Please keep in mind that if you make replacements the same replacement string will be used in for each instance of a search hit.

  • Searches are 'whole word' searches, which means the string you provide surrounded by any of these characters (using the ASCII table):
    <000> thru / : thru @ [ thru ` { thru ¿
    For example, 'truck' does not find 'trucks' but it would find 'truck' in '/truck<cr>'.

  • The ( and ) characters have special meaning using this method and cannot be used as literal characters. Likewise, there is no escape (literal) for the '&', '|', and '~' characters. If your search requires literal &, |, ~, or ( ), use a script that has a complex Expression Evaluator term.

  • Spaces are interpreted literally. For example, 'find me' looks for that literal phrase, not the single words 'find' and 'me'.

Examples:

To find files that contain the words 'this' and 'that', use (don't include the S: part):
S: this&that

To find files that contain the words 'this' and 'that' or 'find me':
S: (this&that)|find me

To find files that contain the words 'trucks' or 'cars' or 'boats' but not if the words 'planes' or 'rockets' are present in the file:
S: (trucks|cars|boats)~(planes|rockets)

To find files that contain the words 'rocket ship' and 'that', where 'rocket ship' is possibly on two adjacent lines with no characters in between, enable 'Ignore Whitespace' and 'Whole Word' mode and search for:
S: (rocket ship)|that


Binary Mode (Special Characters or Multiple Lines) Dialog

Binary Mode Dialog

The binary mode dialog is activated by the [image] buttons next to the Search and Replace string fields in the main window and Script Editor. The uses for this dialog include:

  • Multi line search / replace strings and binary characters such as tabs and special characters.

  • Reformat files at a specified column using the %%srformat%%= code (Search string).

  • Add Lines to Files (Prepend / Append).

  • Use Environment Variables in the search / replace strings.

  • Apply Scripts to the search &/or replace strings in advance of a later operation - useful for handling the plain text conversions needed when dealing with RTF, Unicode, or html documents.

Note: Search/replaces involving a literal \ character must doubled, \\, in the binary mode search/replace strings. This is so even if the operation does not involve regular expressions. For example, to find '\example\registry_toolkit' in your files, use the string '\\example\\registry_toolkit'.

Important Note: While Search and Replace allows replacing in binary files (such as .DOC, .XLS etc.), these proprietary format files may contain internal counters which may get out of synch. As a result, the application that created the file may not be able to read it. For best results, replace in ASCII text files only (such as .HTM, .RTF, .TXT, .INI, .C, .CPP, .H etc.). Word files should be converted to RTF format before you operate on them. Please See Word Documents Notes for more important information on search & replaces in non-text files such as Word documents, Word Perfect documents, spreadsheets, etc.

Click on the graphic below for help on the Binary Mode fields or scroll the screen down for a text description of the fields.

Details on the Binary Mode Fields:

Search/Replace Block field: You can type, paste (using paste button or Ctrl+V) text already in the Clipboard or use the Binary Codes list (below) to add characters to this field. You can perform the usual editing operations in this field by using the keyboard as follows:

Copy | Ctrl+C
Paste | Ctrl+V
Cut | Ctrl+X
Undo | Ctrl+Z

Special Operations group (Search field only): You can instruct Search and Replace to prepend (add to the beginning of the file) or append (add at the end of the file) a block of text to each file processed or to simply use the Search String entered. The string in the Replace field will be prepended or appended. You can confirm replacing the same way you can with regular search strings. The Search Block field will change accordingly if you select "Add to top of file" or "Add at bottom of file". This radio button area is not available when editing a binary replacement string.

Binary Codes fields: This list allows you to add special characters to the Search/Replace field by either double-clicking or selecting an item and then clicking the Add Code button. The list of 'special character codes' can be seen HERE.

Add Code button: The Binary Code specified will be added to the Search/Replace Block field.

OK button: The Search/Replace field will be used as specified.

Cancel button: No changes are made.

Paste Text: The text currently in the clipboard is pasted in the Search/Replace Block field. If anything is selected in the Search/Replace field, the selection will be replaced by the text pasted. If no text is in the clipboard, nothing will happen.

Apply Script button: Click here to apply a script to the search/replace string in advance of a later operation. See Apply Script function for more information.


Special (Binary) Characters: Using

Using Special Characters

You can process binary characters, line feeds, tabs, etc by using the Binary Mode dialog, which is available via the [image] buttons next to the Search and Replace String fields in the main window and the Script Editor.

Some frequently used special characters include:

  • \r\n - DOS linefeed sequence

  • \r - MAC linefeed sequence

  • \n - UNIX linefeed sequence

  • \t - TAB character

Notes:

  • Literal \ characters MUST be doubled as \\ to denote the literal.

  • The Binary Mode dialog can also be used with Regular Expressions.

  • For multi-line operations where you are not concerned with CR LF's or Tab's per se, consider using the *[] regular expression search operator.

  • The \0x?? style terms are based on Hex values, not Decimal. If you are familiar with the standard ASCII chart, go by the Hex values.

  • It is OK to use the \0x?? style even if a character has a standard alphanumeric representation. For example, the capital A character is hex 41 or \0x41 using the Search and Replace style.

Here is the list of Special characters. The \0x?? Style column is included for those who have a need to use hex values instead of the standard characters.

Character Codes
Code | Explanation | \0x?? Style | Code | Explanation | \0x?? Style
\0x00 | Character 0 | \0x00 | \0x7f | Character 127 | 0x7f
\0x01 | Character 1 | \0x01 | \0x80 | Character 128 | \0x80
\0x02 | Character 2 | \0x02 | \0x81 | Character 129 | \0x81
\0x03 | Character 3 | \0x03 | \0x82 | Character 130 | \0x82
\0x04 | Character 4 | \0x04 | \0x83 | Character 131 | \0x83
\0x05 | Character 5 | \0x05 | \0x84 | Character 132 | \0x84
\0x06 | Character 6 | \0x06 | \0x85 | Character 133 | \0x85
\a | ASCII Bell | \0x07 | \0x86 | Character 134 | \0x86
\b | ASCII Backspace | \0x08 | \0x87 | Character 135 | \0x87
\t | TAB | \0x09 | \0x88 | Character 136 | \0x88
\n | Line Feed (1) | \0x0a | \0x89 | Character 137 | \0x89
\v | Vertical TAB | \0x0b | \0x8a | Character 138 | \0x8a
\f | Form Feed | \0x0c | \0x8b | Character 139 | \0x8b
\r | Carriage Return (1) | \0x0d | \0x8c | Character 140 | \0x8c
\0x0e | Character 14 | \0x0e | \0x8d | Character 141 | \0x8d
\0x0f | Character 15 | \0x0f | \0x8e | Character 142 | \0x8e
\0x10 | Character 16 | \0x10 | \0x8f | Character 143 | \0x8f
\0x11 | Character 17 | \0x11 | \0x90 | Character 144 | \0x90
\0x12 | Character 18 | \0x12 | \0x91 | Character 145 | \0x91
\0x13 | Character 19 | \0x13 | \0x92 | Character 146 | \0x92
\0x14 | Character 20 | \0x14 | \0x93 | Character 147 | \0x93
\0x15 | Character 21 | \0x15 | \0x94 | Character 148 | \0x94
\0x16 | Character 22 | \0x16 | \0x95 | Character 149 | \0x95
\0x17 | Character 23 | \0x17 | \0x96 | Character 150 | \0x96
\0x18 | Character 24 | \0x18 | \0x97 | Character 151 | \0x97
\0x19 | Character 25 | \0x19 | \0x98 | Character 152 | \0x98
\0x1a | Character 26 | \0x1a | \0x99 | Character 153 | \0x99
\0x1b | Character 27 (ESC) | \0x1b | \0x9a | Character 154 | \0x9a
\0x1c | Character 28 | \0x1c | \0x9b | Character 155 | \0x9b
\0x1d | Character 29 | \0x1d | \0x9c | Character 156 | \0x9c
\0x1e | Character 30 | \0x1e | \0x9d | Character 157 | \0x9d
\0x1f | Character 31 | \0x1f | \0x9e | Character 158 | \0x9e
 | (space) | \0x20 | \0x9f | Character 159 | \0x9f
! | ! | \0x21 | \0xa0 | Character 160 | \0xa0
\" | " | \0x22 | \0xa1 | Character 161 | \0xa1
# | # | \0x23 | \0xa2 | ¢ | \0xa2
$ | $ | \0x24 | \0xa3 | £ | \0xa3
% | % | \0x25 | \0xa4 | ¤ | \0xa4
& | & | \0x26 | \0xa5 | ¥ | \0xa5
\' | ' | \0x27 | \0xa6 | ¦ | \0xa6
( | ( | \0x28 | \0xa7 | § | \0xa7
) | ) | \0x29 | \0xa8 | ¨ | \0xa8
* | * | \0x2a | \0xa9 | © | \0xa9
+ | + | \0x2b | \0xaa | ª | \0xaa
, | , | \0x2c | \0xab | « | \0xab
- | - | \0x2d | \0xac | ¬ | \0xac
. | . | \0x2e | \0xad |  | \0xad
/ | / | \0x2f | \0xae | ® | \0xae
0 | 0 | \0x30 | \0xaf | ¯ | \0xaf
1 | 1 | \0x31 | \0xb0 | ° | \0xb0
2 | 2 | \0x32 | \0xb1 | ± | \0xb1
3 | 3 | \0x33 | \0xb2 | ² | \0xb2
4 | 4 | \0x34 | \0xb3 | ³ | \0xb3
5 | 5 | \0x35 | \0xb4 | ´ | \0xb4
6 | 6 | \0x36 | \0xb5 | µ | \0xb5
7 | 7 | \0x37 | \0xb6 | ¶ | \0xb6
8 | 8 | \0x38 | \0xb7 | · | \0xb7
9 | 9 | \0x39 | \0xb8 | ¸ | \0xb8
: | : | \0x3a | \0xb9 | ¹ | \0xb9
; | ; | \0x3b | \0xba | º | \0xba
< | < | \0x3c | \0xbb | » | \0xbb
= | = | \0x3d | \0xbc | ¼ | \0xbc
> | > | \0x3e | \0xbd | ½ | \0xbd
\? | ? | \0x3f | \0xbe | ¾ | \0xbe
@ | @ | \0x40 | \0xbf | ¿ | \0xbf
A | A | \0x41 | À | À | \0xc0
B | B | \0x42 | Á | Á | \0xc1
C | C | \0x43 | Â | Â | \0xc2
D | D | \0x44 | Ã | Ã | \0xc3
E | E | \0x45 | Ä | Ä | \0xc4
F | F | \0x46 | Å | Å | \0xc5
G | G | \0x47 | Æ | Æ | \0xc6
H | H | \0x48 | Ç | Ç | \0xc7
I | I | \0x49 | È | È | \0xc8
J | J | \0x4a | É | É | \0xc9
K | K | \0x4b | Ê | Ê | \0xca
L | L | \0x4c | Ë | Ë | \0xcb
M | M | \0x4d | Ì | Ì | \0xcc
N | N | \0x4e | Í | Í | \0xcd
O | O | \0x4f | Î | Î | \0xce
P | P | \0x50 | Ï | Ï | \0xcf
Q | Q | \0x51 | Ð | Ð | \0xd0
R | R | \0x52 | Ñ | Ñ | \0xd1
S | S | \0x53 | Ò | Ò | \0xd2
T | T | \0x54 | Ó | Ó | \0xd3
U | U | \0x55 | Ô | Ô | \0xd4
V | V | \0x56 | Õ | Õ | \0xd5
W | W | \0x57 | Ö | Ö | \0xd6
X | X | \0x58 | \xd7 | Character 215 | \0xd7
Y | Y | \0x59 | Ø | Ø | \0xd8
Z | Z | \0x5a | Ù | Ù | \0xd9
[ | [ | \0x5b | Ú | Ú | \0xda
\\ | \ | \0x5c | Û | Û | \0xdb
] | ] | \0x5d | Ü | Ü | \0xdc
^ | ^ | \0x5e | Ý | Ý | \0xdd
_ | _ | \0x5f | Þ | Þ | \0xde
` | ` | \0x60 | ß | ß | \0xdf
a | a | \0x61 | à | à | \0xe0
b | b | \0x62 | á | á | \0xe1
c | c | \0x63 | â | â | \0xe2
d | d | \0x64 | ã | ã | \0xe3
e | e | \0x65 | ä | ä | \0xe4
f | f | \0x66 | å | å | \0xe5
g | g | \0x67 | æ | æ | \0xe6
h | h | \0x68 | ç | ç | \0xe7
I | I | \0x69 | è | è | \0xe8
j | j | \0x6a | é | é | \0xe9
k | k | \0x6b | ê | ê | \0xea
l | l | \0x6c | ë | ë | \0xeb
m | m | \0x6d | ì | ì | \0xec
n | n | \0x6e | í | í | \0xed
o | o | \0x6f | î | î | \0xee
p | p | \0x70 | ï | ï | \0xef
q | q | \0x71 | ð | ð | \0xf0
r | r | \0x72 | ñ | ñ | \0xf1
s | s | \0x73 | ò | ò | \0xf2
t | t | \0x74 | ó | ó | \0xf3
u | u | \0x75 | ô | ô | \0xf4
v | v | \0x76 | õ | õ | \0xf5
w | w | \0x77 | ö | ö | \0xf6
x | x | \0x78 | 0xf7 | Character 247 | \0xf7
y | y | \0x79 | ø | ø | \0xf8
z | z | \0x7a | ù | ù | \0xf9
{ | { | \0x7b | ú | ú | \0xfa
| | | | \0x7c | û | û | \0xfb
} | } | \0x7d | ü | ü | \0xfc
~ | ~ | \0x7e | ý | ý | \0xfd
 |  |  | þ | þ | \0xfe
 |  |  | ÿ | ÿ | \0xff


Binary Mode - Double Reserved Characters

The \ character is used to input special (binary) characters. To use a literal \ character (for example in a path), you must enter it as \\. Select Yes to parse the string and change all \s to \\.


Add Lines To Files

There are two methods to add text to the start or end of a file.

1. Binary Mode Prepend and Append Function

The Prepend / Append function is a special operation that is available in the Binary Mode dialog for the Search string. This function allows you to add the Replace string to the top or bottom of the files specified by the mask & path.

To activate prepend or append, click on the [image] button next to the Search string in the main window or the Script Editor and select "Add at top of file" or "Add at bottom of file". The Replace string will be inserted accordingly when you do a Search/Replace. A confirmation dialog allows you to confirm whether or not to perform prepend and append replacements (see when replacement prompts are set to "Prompt on All" (see Replace Options ).

See Special Script Prepend-Append Operators for information on operators that are available for scripted operations.

2. Regular Expressions

You can use a regular expression operator to identify a string at the very top or bottom of a file and combine this with a replace term that includes the appropriate line end character for the type of file you are operating on.

For example, the add a string to the top of a file, perhaps use:

Search: ^*
Replace: What you want to add\r\n%1%2
as your terms.

Note: The "Stop processing after first hit in file" switch (Options-Search) may be helpful here.


Prepend - Append Confirmation Dialog

Prepend & Append Confirmation Dialog

Prepend and Append is a special Binary Mode function of the Search string that allows you to add the Replace string to the top or bottom of the files specified by the mask & path. You can use this to add lines to the beginning or end of a file.

To activate prepend or append, click on the [image] button next to the Search string in the main window or the Script Editor and select "Add at top of file" or "Add at bottom of file". The Replace string will be inserted accordingly when you do a Search/Replace.

A confirmation dialog allows you to confirm whether or not to perform prepend and append replacements (see when replacement prompts are set to "Prompt on All" (see Replace Options ). The action of the buttons is:

Yes Button: The pending prepend or append is readied. You will receive an additional replacement confirmation prompt as the replacement is made. You may cancel the replacement in the second confirmation dialog by clicking the "No" button. If you chose the "Cancel" button in the second replace confirmation dialog, the entire operation will be cancelled.

Yes to All Button: All prepends or appends are performed in all remaining files that meet your file mask, path, and filter criteria. No additional prompts will be offered.

No Button: The pending prepend or append is canceled. If there is only one file that meets your mask, path, & filter settings, the operation ends.

Cancel Button: Aborts all remaining prepend or append replacements.


Append Confirmation

Prepend and Append is a special Binary Mode function of the Search string that allows you to add the Replace string to the top or bottom of the files specified by the mask & path. You can use this to add lines to the beginning or end of a file.

To activate prepend or append, click on the [image] button next to the Search string in the main window or the Script Editor and select "Add at top of file" or "Add at bottom of file". The Replace string will be inserted accordingly when you do a Search/Replace.

A confirmation dialog allows you to confirm whether or not to perform prepend and append replacements (see when replacement prompts are set to "Prompt on All" (see Replace Options ). The action of the buttons is:

Yes Button: The pending prepend or append is readied. You will receive an additional replacement confirmation prompt as the replacement is made. You may cancel the replacement in the second confirmation dialog by clicking the "No" button. If you chose the "Cancel" button in the second replace confirmation dialog, the entire operation will be cancelled.

Yes to All Button: All prepends or appends are performed in all remaining files that meet your file mask, path, and filter criteria. No additional prompts will be offered.

No Button: The pending prepend or append is canceled. If there is only one file that meets your mask, path, & filter settings, the operation ends.

Cancel Button: Aborts all remaining prepend or append replacements.


Customer Support

Customer Support Information

If you have a question that is not answered in the documentation, a FAQ (Frequently Asked Questions) document is available on our Web site at: http://www.funduc.com. If you need further assistance, contact us directly by E-MAIL at support@funduc.com. Please give as much detail as possible about the operation you want to perform (example lines before and after the replace operation, search and replace strings used, etc.).

Registered users are eligible for support and quarterly updates for a period of six months.

Shareware Users: We will do our best to answer your questions, however, please be aware that ongoing support necessitates that you register Search and Replace.

To report a bug, E-MAIL: support@funduc.com.

We welcome suggestions for improving Search and Replace. If you have a suggestion, please check the documentation and the READ.ME file to make sure it is not already implemented or planned. If not, drop us a note at support@funduc.com.

For ordering information, please see the section Ordering Information.

Thank you for using Funduc Software products!


Acknowledgments

The portion of Search and Replace that searches through Zip files is based on the work of the Info-Zip group and used with their permission. Thanks to the entire Info-Zip group, in particular to Jean-loup Gailly, Greg Roelofs, and Mark Adler. If you are interested, you can obtain the Info-Zip code from many sources, including: CompuServe (ibmpro forum); BIX: (ibm.pc listings); Internet (ftp.uu.net:/pub/zip). If you cannot obtain this file from other sources you can send a self-addressed-stamped envelope with a disk to the address in the "About" dialog box.

Thanks to our tireless translators for their work on preparing the language interfaces and documentation for Search and Replace and our other products. Write them if you are in need of localization services. Our group includes:

Translator | Version
Holger Sehlke (http://www.lad-dir-was.de/formularp.html) | German interface & documentation
Bernard Meunier | French interface & documentation.
Bert Hankes | Dutch interface & documentation
Reggie | Portuguese interface
Kristian Rudd | Norwegian interface
Koichi Yoshimura | Japanese interface & documentation
Mathias Thinsz | Swedish interface

Finally, thanks to you, our customers, for your suggestions & support!


Language Support

International Language Support

Visit our web site at http://www.funduc.com for details about language modules for Search and Replace. German, French, Japanese, Italian, Portuguese, Norwegian, and Dutch versions are currently available (See Acknowledgments ).

Contact Mike Funduc by EMail at mike@funduc.com if you would like to create a version for your native language. DLLs and documentation for other languages will be posted on our web site, http://www.funduc.com, as they become available.


Licensing Information

License Information

Search and Replace for Windows
Copyright (c) 1995-2010 by Funduc Software Inc.
All rights reserved.

See Ordering Information for more information on how to purchase Search and Replace.

License Agreement and Warranty Disclaimer

You should carefully read the following terms and conditions before using this software. Use of this software indicates your acceptance of these terms and conditions. If you do not agree with them, do not use the software.

Shareware Version License

By using this software you accept full responsibility for usage and results.

The Shareware Version is not free software. If you are using the Shareware Version you are hereby licensed to use this software for evaluation purposes without charge for a period of 30 days. If you use this software after the 30 day evaluation period a registration fee is due (see Ordering Information).

If you are using the Shareware Version of the software you are also hereby licensed to: Make as many copies of the Shareware version of this software and documentation as you wish; Give exact copies of the original Shareware version to anyone; Distribute the Shareware version of the software and documentation in its unmodified form via electronic means. There is no charge for any of the above.

Unregistered use of Search and Replace after the 30-day evaluation period is in violation of federal copyright laws.

You may not decompile, disassemble, or reverse engineer Search and Replace (shareware) in any manner.

Registered Version License

One registered copy of Search and Replace for Windows may be dedicated to a single person who uses the software on one or more computers or workstations that are for their own exclusive use and for which they are the sole user. There is no restriction on the number of files or their location that the user(s) can use the program on.

A single user license may not be made available in any form to multiple users or workstations.

Licensing is not based on "concurrent" users. If multiple workstations are to access the program in any form and for any length of time you must purchase licenses for the number of workstations that will access the program. If you make the registered version of Search and Replace available through a network and accessible by multiple users or workstations you are required to purchase licenses for the software covering all workstations that will access the software through the network. Discount pricing is available for multiple licenses. See Ordering Information for information on how to purchase (register).

Customer support can be obtained by visiting our homepage at http://www.funduc.com or by E-MAIL (support@funduc.com).

You may not decompile, disassemble, or reverse engineer Search and Replace (registered) in any manner.

Workstation Update and/or Special Use License

A single user license may not be used as part of an automated, server-based routine for modifying workstations. This includes routines where the individual workstation user(s) may not have interactive access to the program. Please contact support@funduc.com if you have a special use request involving multiple workstations that will access the program for workstation updating or modification routines.

www Server Use

As implied by the Registered Version License section above, the program may not be made available as part of a web server service. We have other software intended for this purpose. Please contact support@funduc.com for more information.

Restrictions

You are prohibited by law from selling, renting, leasing, loaning, or donating the program or documentation in whole or in part without specific advance agreement between yourself and Funduc Software, Inc. You are prohibited by law from redistributing the registered version of the program by any method or in any form except to the specific individuals for whom the software was purchased. You are prohibited from decompiling, reverse engineering, disassembling, or otherwise reducing the program to human readable form for any purposes whatsoever. You may not modify the program or documentation in any manner. You are prohibited from permitting anyone else from undertaking any of the above actions.

Ownership Rights

Funduc Software, Inc. owns and retains all copyrights, patents, trade secret rights, trademarks and intellectual property rights to this software. Registration &/or use of the software does not grant you any right to the intellectual property in the product.

Customer Support

Customer support can be obtained by visiting our homepage at www.funduc.com or www.searchandreplace.com by E-MAIL (support@funduc.com).

Governing Law

This agreement shall be governed by the laws of the State of Michigan, United States.

Disclaimer of Warranty

This software and the accompanying files are sold "as is" and without warranties as to performance of merchantability or any other warranties whether expressed or implied. In particular, there is no warranty for the string Replacing feature.

Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program. Any liability of the seller will be limited exclusively to product replacement or refund of purchase price.


Search and Replace Shareware Version

Search and Replace Shareware

Thank you for trying the shareware version of Search and Replace. The shareware license is for a 30 day evaluation period from when you first install the program.

The only functional limitation in the shareware version is that you are limited to replacements in the first five files per session. Otherwise, the software is fully operational.

There is no 'splash' screen whatsoever in the registered version. If you are unattended testing scripts with the shareware, the registered version does not require you to manually dismiss any initial startup screen.

Regarding customer support for the shareware version - If you have a question that is not answered in the documentation, please see the Search and Replace FAQ on our Web site (http://www.funduc.com). If you need further assistance, you may contact us by E-MAIL at support@funduc.com and we will do our best to answer your questions. However, please be aware that ongoing support necessitates that you register Search and Replace.

Please see Purchase & Order Information for how to obtain a registered version of Search and Replace.


Install and Uninstall

Install and Uninstall Information

We recommend you install via the executable .exe installers. These installers will put the program in the path of your choice and establish start menu shortcuts to the program. All files related to the program go in a single path. No files are installed in your '\system' or '\system32' path. No changes are made to any 'windows system files'.

The .exe installers create an uninstall entry in Control Panel, Add/Remove Programs. We suggest you use that to uninstall the program.

If you install manually from a .zip download, please see the 'Install.txt' included in the distribution .zip. Uninstall information is included in that zip.

Write support@funduc.com if you want information about the Search and Replace Explorer shell extensions. It is possible to install the program but not use the shell extensions. We will follow up with you directly.


Ordering and Purchase Information

Purchasing Information

The base price of Search and Replace is $25/single user, plus $8 to $10 S&H if you want a diskette sent by US or International mail. Email delivery is free. Quantity discounts are listed in the fax/mail order form and on our WWW site at http://www.funduc.com. Online purchasing has the option for discount pricing on package licensing of 32-bit and x64 versions.

Registration includes free program updates and customer support (by Email) for six months. Updates are sent to registered customers quarterly. They incorporate your suggestions, so please send them! If you have problems receiving the program or need customer support, contact us by Email at support@funduc.com or support@searchandreplace.com.

Credit Card Registration:

  • Secure Internet Transaction: If you have a secure Web browser such as Netscape or Internet Explorer, you may register by credit card via a secure Web transaction from our web site at: http://www.funduc.com. Online purchasing has the option for discount pricing on package licensing of 32-bit and x64 versions.

  • Fax Registration: To register using a credit card via fax, open and print the fax/mail order form. You may also edit and print the file 'Order.txt' or 'Order64.txt' (x64 version) in the program subdirectory. Please write clearly or type when you complete the form. Please check our web site - www.funduc.com/contact.htm - for the fax number to use. Fax orders are processed within a few hours during the USA business day. Allow 7-10 days for postal deliveries. Write support@funduc.com if you have a question about your order.

  • Phone Registration: Call the number indicated on the page at www.funduc.com/contact.htm to order using a credit card. Please specify that the order is for Search and Replace. Phone orders with email delivery are typically processed within one business day. Allow 7-10 days for postal deliveries. Write support@funduc.com if you have a question about your order.

PayPal Money Transfer: Please write support@funduc.com for instructions about registration via PayPal "Send Money" funds transfer. We will provide you instructions via email reply. Thanks.

Check Registration: Open and print the fax/mail order form. You may also edit and print the file, 'Order.txt', in the program subdirectory. Please write clearly or type when you complete the form. Mail the form and a check to the address indicated on the form. Please allow 7-10 days for check order processing and then contact support@searchandreplace.com or support@funduc.com if you did not receive the program. Payments must be in US dollars drawn on a US bank or international postal money order in US dollars. If you send a postal money order, do so only by some form of registered mail that can be traced!


Search and Replace Mail Order Form

Fax & Mail Order Form

Funduc Software, Inc. - Fax and Mail Order Form

Search and Replace

Funduc Part Number: 286-SR-2500 (32-bit) or 286-SR-2564 (x64) (Circle One)

Fax Orders:

Fax to the number indicated on the page at
www.funduc.com/contact.htm

Check Orders:

Funduc Software, Inc.
P.O. Box 530904
Livonia, MI 48153-0904
USA

-------- PRINT NEATLY OR TYPE! --------

Price Schedule | Price ($US) Per User | Number of Users | Price
Single user | $ 25.00 | _______ | $________
2 to 9 users | $ 23.00 | _______ | $________
10 to 24 users | $ 21.00 | _______ | $________
25 to 49 users | $ 18.00 | _______ | $________
50+ users | $ 15.00 | _______ | $________
Residents of Michigan, United States - add 6% sales tax |  |  | $________
Preferred Shipping Method Disk (USPS Domestic US) $8.00 S&H |  |  | $________
Disk (USPS International) $10.00 S&H |  |  | $________
Email/e-Delivery (Free) |  |  | $___ 0 ___
TOTAL PAYMENT |  |  | $________

Credit Card Information
Card Type (Check One): | Visa[ ] American Express[ ] MasterCard[ ] Discover[ ]
Name as it appears on card: | ____________________________________________________
Credit Card Number: | ____________________________________________________
Expiration Date: | ____________________
Street Address: | ____________________________________________________
Street Address: | ____________________________________________________
City, State Zip: | ____________________________________________________
Country: | ____________________________
Your Information (Write 'Same' if not different from above)
Your Name: | ____________________________________________________
Company: | ____________________________________________________
Street Address: | ____________________________________________________
Street Address: | ____________________________________________________
City, State, Zip: | ____________________________________________________
Country: | ____________________________________________________
Day Phone Number: | ____________________________
Fax Number: | ____________________________
Alt Phone Number: | ____________________________
* EMail Address:* | ____________________________________________________
Signature: | ____________________________________________________
Date: | ____________________________

* Include E-Mail address if you want email delivery.

Comments:


Funduc Software Products

Please visit our Web site at http://www.funduc.com for more information, freeware, shareware, and purchases of these and other products.

Search & Replace

Search and Replace is our award winning utility loved by programmers, webmasters, and novice computer users alike. If you need to find and replace text, or just find text, this utility is a must have.

Search and Replace looks through multiple files for a string and can also replace it with another string. It can search subdirectories and ZIP files and do case sensitive or insensitive searches. Extensive support for regular expression (egrep) search & replacement includes operations that span more than one line, insertion of the path & filename during replacements, and incrementing number replacements. Binary search & replace mode can be combined with regular expressions. Precise control over replacements is available through multiple confirmation options and a built-in context viewer that allows you to view replacements in- context, before they are made. An HTML Mode can be used to make html special character code substitutions during search/replace. Ignore Whitespace mode makes it convenient to handle spaces & cr-lf during non-regular expression operations. A built-in script editor makes frequent &/or complex multi-step search/replace operations easy to prepare. Advanced script operations include a boolean expression evaluator that provides additional control over which files are processed by the script. Advanced scripts also allow you to specify the program options in effect, insert comments in scripts, and perform iterative script operations. Multiple file masks and file date & size filters can be used to include &/or exclude files during regular and scripted operations. The internal context viewer includes a build-in editor for editing text files. The full complement of command line switches (including script launching) is ideal for network managers & advanced users. Other functions include: "Touch" files (change time/date stamp & file attributes); Preservation of original file date during replacements; Replacements on backup path files instead of the originals; Output reports to monitor operations; Shell extensions to launch Search & Replace from Explorer and the Find Menu; and more. A detailed help file with examples are included. Several foreign language interface are available from ttp://www.funduc.com.

Search and Replace has received several awards from WUGNET® (Windows User Group Net) Windows NT Shareware Pick of the Week (www.wugnet.com/shareware), Windows Magazine (www.winmag.com) Superior Shareware, and has been featured several times in Lockergnome's Free Windows 95/NT E-zine (www.lockergnome.com). It has a ZDNet Hotfiles (www.hotfiles.com) of 5 stars, & a TUCOWS (www.tucows.com) 5 Cow rating.

Search and Replace Regular Expression Wizard

Search and Replace Regular Expression Wizard is a step-by-step wizard to help you build regular expressions for use in Search and Replace. The expressions can be constructed from a menu of operators having English language counterparts. The impact of the operators is displayed in color coded form on a sample text you provide. You can move back & forth between search operators - replace operators - final results to adjust your expressions as necessary. When finished, the final expressions are inserted into the corresponding Search and Replace fields if Search and Replace is running. The Wizard itself is freeware. Documentation requires a one time purchase. Search and Replace Regular Expression Wizard is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Directory Toolkit

Directory Toolkit is a multipurpose directory comparison and file manager that provides features missing from Windows. It displays single directory lists or side- by-side directory comparisons using color coding for alike, different, or missing files. Comparisons can be based on dates or a binary file analysis of file content. You can copy, move, & rename files while retaining long filenames and six built-in synchronize functions simplify updating directories. Built-in archive functions, with Explorer shell extensions, let you create & manage archives from Explorer and use Directory Toolkit as your primary archive manager for supported archives (zip, tar, gz, lz (read only), & cab). File operations and directory comparison functions work seamlessly on files in archives, e.g., no need to manually extract files first. Other features include statistics for file counts and path sizes; Ignoring filename case during comparisons; Explorer compatible OLE drag n Drop; Split/Concatenate files to/from diskettes; Encode/Decode UENCODE, Base64(Mime), BinHex(Mac), XXENCODE and yEnc formats, (Decode also includes quoted-printable, 7 bit unencoded, & plain text); An integrated comparison viewer for a color coded display of the actual differences in files; Safe physical sort of directories; Touch files (change time/date & attributes stamps); Find duplicate files on a drive; Open files and launch applications; Multiple include/exclude file masks and the ability to include/exclude files based on size and date; Command line switches & script functions to automate comparisons & synchronize operations & control program options in effect via batch files; Configurable output file and print functions to create reports of single and comparison directory lists; Detects & runs (optionally) setup programs in archives; Display file version information including 8.3 file name equivalents; File numbering to number files sequentially based on adjustable sort order and a user defined starting value. Help file with examples included. International versions are available from http://www.funduc.com.

Directory Toolkit has been a winner of the WUGNET® Windows NT Shareware Pick of the Week for (www.wugnet.com/shareware), WUGNET® Windows95 Best Choice Shareware for the week, and featured Lockergnome's Free Windows 95/NT E-zine (www.lockergnome.com). It has a ZDNet Hotfiles (www.hotfiles.com) of 5 stars.

Funduc Software ZIP Extractor

Funduc Software ZIP Extractor is ZIP "self-extractor stub" that lets you turn your ZIP files into a self-extracting executable that will automatically unZIP the archive when launched. This allows you to share your zip files with another person who might not have an unzip software on their computer &/or who might have only occasional use for an unzip tool. The self-extractor allows some or all files to be extracted and can create the paths in the zip file (default) or "flatten" the directory structure (unzip into a single path).

Replace Studio

Replace Studio Pro and Replace Studio Business are cousins to our award winning Search and Replace utility. Both programs search through one or more files for a string and can replace that string with another string. Choices for search settings include: Subdirectory Search; Archive Search (Zip, Tar, Tar.Gz, Tar.Z, Tgz, Taz); Case Sensitive; Whole Word; Ignore Whitespace; HTML Mode. File Masks and file size &/or date Filter settings are available for further choices about the files to be processed. Like Search and Replace, the Replace Studio utilities have regular expression (egrep) search & replacement functionality for complex search/replaces. A Favorites menu (Pro version) and script editor simplifies user control over frequent &/or complex multi-step search/replace operations. Replacements in files in supported archives can be done directly - no need to manually extract files first. A built-in Context Viewer allows you to view &/or manually edit the files found by the search. The many additional options include: Preservation of original file date during replacements; Replacements on backup path files instead of the originals; Output reporting; Control over results list sorting; File Operations (Pro version) on files found by the search; Launch Explorer on the search results path of a file; Settings to use alternative viewer/editor on found files; Automatic locale-based international versions for supported languages; and more. Replace Studio comes in 32-bit and 64-bit versions for Windows XP and above. Replace Studio Pro is intended for use as a graphical interface program. Although Replace Studio Business Edition also has a graphical user interface, the Business Edition is oriented towards script-based & command line use, where a graphical interface is not necessarily required by the user.

Resource Translation Toolkit

Resource Translation Toolkit (RTT) is utility to simply translation work on po, rc, and tmx files. Various translation suites are available but they are expensive or limited to a single file type. Resource Translation Toolkit is low cost and can work with multiple file types. The program runs on Windows 2000 and above, is small in size (approx 3 MB including support files), and does not place extensive demands on your computer. RTT uses a 'Translation Memory' file, which can be in a TMX or POT format. The program simplifies translation by first removing mnemonics (accelerator keys), shortcut keys (such as Ctrl+C) and punctuation characters from menu and other control text, sorting and consolidating duplicates and presenting them for translation.

Registry Toolkit

Registry Toolkit lets you search &/or replace and edit the Windows registry. You can specify the data types to process, start key, case sensitive, whole word. Regular expression operations using an egrep-type syntax are also available. You can create/edit keys, values, &/or data manually if you wish. A unique 'operations' function lets you move/copy/delete/export values you select. For example, you can copy/move keys from one location in the registry to another. The program now maintains multiple 'undo' files that can be used to reverse previous changes (10 is the default). An automatic 'last change' undo is available from the program GUI. Replaces can be previewed in advance, in-context. Replaces can also be previewed in the context of an overall search - a comparison dialog then lets you select/deselect specific operations to perform before making the overall replace. The program can print search & registry browse results. The .reg import function allows you to compare existing data vs. data to be imported - specific items can then be selected/deselected. The .reg export function can be used to make special .reg files that delete keys when merged via Registry Toolkit or our new Registry Toolkit Merge program (see our web site). The various program comparison dialogs are configurable and their contents can be copied to the windows clipboard. The program can read DOS environment variables and use them in a search/replace. Script file & command line functions are available for automated &/or complex operations. Registry Toolkit will operate on a remote registry (if you have permission to do so). A German interface is available.

Registry Toolkit Merge

Registry Toolkit Merge is a companion program for Registry Toolkit. Registry Toolkit Merge is a command line that merges .reg files into the Windows registry. Registry Toolkit Merge is unique because it can be used to create self-contained, self-importing .exe's. When clicked on, the .reg information is imported into the registry (after confirmation). This is be useful, for example, if you need to distribute a .reg file to others but are worried that they might not know how to import a .reg file manually. Alternatively, a .reg file can be passed to the program from the command line. Like Registry Toolkit, the program can be used to apply .reg files that will delete keys from the registry or copy/move them to another location -- tasks that cannot be accomplished easily by the regedit.exe .reg merge function that comes with Windows.

Folder Synchronize

Folder Synchronize is a command-line utility useful to network administrators and other power users. It provides a subset of the functions in our Directory Toolkit utility, namely, the comparison & synchronize functions. We created Folder Synchronize for those who needed those functions but not the GUI interface & other functions of Directory Toolkit such as archive management, file operations, etc. Folder Synchronize is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Folder Synchronize can synchronize two paths using one of 6 synch methods. The program can also do a comparison-only. This is useful with the output report function. When the output report is enabled it will contain a summary of the path comparison &/or a summary of the file operations carried out by the synchronize. Other features include: Switchable display (or not) of a progress meter; A custom bitmap & message of your choice can be displayed on the screen while an operation progresses; A 'No Cancel' switch can be used to make it less easy for a procedure to be interrupted; Require (or not) confirmation of file operations; Complex include/exclude file masks that let you include/exclude some file or subdirectories while including others; Multiple operations can be submitted to the program via multiple 'configuration files'.

Folder Synchronize Script Editor

The 'Script Editor' is used to generate (or edit) script files that can then be used with Folder Synchronize or our Directory Toolkit utility. The script switches are presented in an organized arrangement. The display of related switches can be collapsed/expanded for readability. Folder Synchronize Script Editor is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Application Mover

Application Mover is a tool that relocates installed programs from one path to another on your hard disk. Application Mover takes files found one path and moves them to another that you specify. Application Mover scans the windows registry for references to old file location and adjust the registry to the new location. Application Mover also scans all windows shortcuts in the Start Menu and adjusts those as well. *.ini and *.log files present in the program's path are updated to reflect the new location of your program. Application Mover is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Application Inventory

Application Inventory is a utility that scans your system for program .exe files and generates a configurable report about the files that were located. Optional follow-up scans are then initiated to cross-reference the initial scan results with windows .lnk shortcuts and/or references in the windows registry. Further details on files are available from Properties and References dialogs. Include and exclude filters are available to define the initial search by path &/or string(s) found in file version information. The fields included in the initial file scan are configurable. Results be sorted, copied to the clipboard, printed, or saved in a delimited file you specify. Application Inventory can also launch windows explorer on the path containing a file in the results list. Although Application Inventory is intended as a reporting tool, various windows properties sheets can be launched that allow you to make edits to file or shortcut properties. The program defaults to scanning for .exe files but a special switch is available to scan for another file type that you specify. Application Inventory is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Duplicate File Finder

Duplicate File Finder is utility that locates duplicate files on in one or more paths. Unlike other utilities that only check file names, Duplicate File Finder performs a binary comparison of file contents and can locate files that are alike regardless of names. The path(s) to scan is configurable by file path and file mask(s) and filter settings can be used to include/exclude files by date, size, attribute. Results can be saved to a tab delimited file. Supplementary functions include launching files, deleting files to the recycle bin, opening Explorer on a path, and examining file properties. Duplicate File Finder is available in 32-bit or 64-bit (x64) versions for Windows XP and above.

FSDBMgr - A Freeware Database Manager for SQLite

FSDBMrg (Funduc Software Database Manager) is an open source, customizable database manager for SQLite. The source code and compiled working demo with a sample database is available on our www site. SQLite was our choice for the database but the program can be easily modified to work with any database for which an ADO .Net provider is available. The demo code includes functions to: Find & modify customer and purchase history; Importing records saved in text format; Saving and running custom SQL; Generating pdf receipts; Tracking sales tax.

File Merge Express

File Merge Express is a file comparison and merge utility for 32 bit Windows. The program displays a contents comparison of two files and can (optionally) create a third file, 'Merge File' that consists of the merge of the two files being compared. The Merge File can (optionally) be opened in the built-in text (or binary) editor. The program has options for file naming of the Merge File, including automatic naming when the two source files for the comparison have the same name. The Compare Files dialog is also used to establish parameters such line prefixes, colors, orientation of the preview, etc. Command line parameters are available to specify files to compare or a script file to use. The program can also be launched from the Windows Explorer right click menu. File Merge Express will also supplement our Directory Toolkit utility. If both programs are installed, Directory Toolkit's file contents comparison will automatically employ File Merge Express, which has more features than Directory Toolkit's internal routine. File Merge Express is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Delivery Agent

Delivery Agent is a send-only e-mail program, with mail merge functions, for use by web site managers, network administrators, customer relations and support personnel, etc. The program is used to deliver frequently used, customer-requested e-mail messages (& MIME attachments) such as newsletters, product delivery & announcements, support notes, etc. Messages can be sent to one or more users by selecting a message from a list and entering the users' address. The program can read a text file containing a list of addresses for bulk delivery. Recipients of bulk deliveries are shielded from seeing the other recipients in the list. The program checks a POP e-mail account prior to sending message via SMTP - useful for servers that 'validate' the users current IP address prior to mail relays. Version 3.0 adds MAPI support. When activated, the program will route outgoing messages to your primary MAPI-aware e-mail program. Mail merge field name definitions, variable names, and data are stored in a single file containing the data and e-mail addresses. Variable names can be anything you like (except for the name of the e-mail address field). Mail Merge 'Constants' can also be defined. The program has a customizable header function that can be used to send web mail' or 'HTML mail'. The "To: " field can also be customized for bulk, non- mail merge deliveries. Port settings to use and maximum number of recipients per block can be configured manually. Settings and messages can be created via the program GUI or, once you are familiar with the program, via an external text editor. A full complement of command line switches allows the program to be incorporated into your .bat routines. A log file of deliveries can be enabled (or not).

Shortcut Doctor

Shortcut Doctor allows you to check your Windows links/shortcuts and see which contain targets which can no longer be found. The program can then delete the shortcuts, resolve them, or carry out search/replace operations to modify shortcut fields with or without validation of new paths. Network Drive mappings can be inserted in the Replace dialog automatically. Individual shortcuts can be edited and all shortcuts on a drive can be displayed, regardless of whether they are valid or not. Explorer Internet URLS can also be checked for problems. CD-ROM drives, network drives, and specific paths can be ignored during processing. Includes an Empty Recent Documents button. Script files, run from the command line, allow you to do multiple operations, control program options, and easily specify complex paths. A German interface is available. Shortcut Doctor is available in 32-bit and 64-bit (x64) versions for Windows XP and above.

Funduc Explorer Extensions

Explorer Extensions is a collection of enhancements for the Windows Explorer right-click context menu: a) Encode and Decode Email attachments - support for UUENCODE, Base64(Mime), BinHex(Mac), XXENCODE, quoted-printable, 7 bit unencoded, & plain text, b) Split and Concatenate large files into smaller ones for storage on floppies & visa versa. Split can be based on file size or a string found in a file, c) Touch files - change the time, date, & attributes of files. Touch can add (or subtract) a user specified time value from the current file time. d) File Operations - copy/move/rename/delete files using complex file masks. The program can also change the case of file names & number files. Explorer Extensions is available in 32-bit and 64-bit (x64) versions for Windows XP and above. A German version is available.

Drive Bar

Drive Bar allows you to conveniently open views of your drives in the Windows Explorer. Drive Bar's Auto Hide function allows it to disappear from view when not in use so that it does not take up screen space. Drive Bar is resizable and can be set to remain visible at all times. It can also be set to launch alternative file manager programs in lieu of Windows Explorer, launch views as "Tiled" or not, ignore specified drives in the list of drive icons, and run automatically at Windows startup.

Update Toolkit

Update Toolkit is a multi-purpose application intended for administrators network managers. This program was created for those who need some or all of the separate functions of our Folder Synchronize, Shortcut Doctor, Registry Toolkit, and Search and Replace utilities under one command line application. Operations are controlled by scripts and are highly configurable. While Update Toolkit can be used on individual machines, it is oriented toward 'logon-script' operations for workstations. The program has no user interface and therefore is well suited for automated operations.

Count Characters (freeware)

Count Characters copies most Windows controls' data to the clipboard! That's just one of the features of this freeware program from Funduc Software. The program can report the type and content of some of the windows currently displayed on your desktop and for the most popular types of controls (including lists and trees) it can copy their contents to the clipboard. You can also copy the contents of password fields and regular text boxes. Cost: Fre.

Decode Shell Extension (freeware)

Decode Shell Extension is very popular freeware app is an extension for the Windows Explorer. The program allows you to decode Internet email attachments by right-clicking on a saved message file from Explorer and selecting Decode from the menu. The program supports multiple attachments, multi-part files (already concatenated), UUENCODED, Base64(MIME), BinHex (Mac format), quoted-printable, XXENCODED, plain text files, and User (table) encoded files. If the attachment contains only one file, Decode Shell Extension will offer to open it using either the associated program or Notepad. For virus safety reasons, it will not offer to launch .exe., .com, .bat, & .cmd files. You should scan decoded Word and Excel files with your anti-virus checker before loading them.

Word Search and Replace

Word Search and Replace is a freeware macro for Microsoft Word. It uses the 'find and replace' functions of MS Word to perform a search/replace in one or more files selected by a file mask supplied by the user. We created 'WordSR' for those who need to search/replace in Word documents only. The macro can use the Word 'Pattern Matching' regular expression switch. Case Sensitive and Whole Word search/replace is also possible

Excel Search and Replace

Excel Search and Replace is a counterpart to our Word Search and Replace. This is a freeware macro for Microsoft Excel that searches (and replaces) in multiple .xls files using Excel's built-in find & replace function.

PowerPoint Search and Replace

PowerPoint Search and Replace rounds out our collection of freeware find and replace Office Macros. This macro is a PowerPoint .ppt file that works with MS PowerPoint files using the find and replace functions that are part of PowerPoint. You need to have the full version of PowerPoint installed. The macro can be run as a slide show but it will not work if you only have the PowerPoint Show Viewer from Microsoft.

TZAdjust (freeware)

TZAdjust, which stands for Time Zone Adjust, is a freeware app we created for users who find it necessary to make manual changes to the Windows time zone and 'day light savings' offset parameters. TZAdjust is probably of greatest interest to Windows NT-class users. NT/2000/XP returns time information as an offset from Greenwich Mean Time (GMT). In addition, the OS automatically makes Daylight Savings compensations when reporting file times. One can disable "Automatically Adjust for Daylight Savings" entirely in the Windows Day/Time Properties dialog but there may be other instances where finer control over time zone and the daylight offset is desired. Do not use TZAdjust casually. Be sure to read the information in the 'readme.txt' before using this program.

FS Touch (freeware)

Funduc Software Touch is a free 'touch' utility to change the time/date & attribute stamps on one or more files. The program can be run from a graphics screen or from the command line. The program runs on Windows XP and above.

FSHED (freeware)

FSHED is a freeware hex editor we created for users of our Search and Replace and Replace Studio Pro & Business windows grep utilities who needed a hex editor/viewer for use when search-replacing 'binary' files. FSHED is not intended to be a full featured programmers hex editor. But if you need a lightweight editor that is free, you are welcome to use it. Features include: Mutli-file editing; File Insert; File Revert; Bookmarks; Clipboard Paste choices; Block Selection; Search/Replace; Read only switch; Print Preview; Display Choices (Bytes per line, Offset length, ANSI/OEM, Little-Endian/Big-Endian, Font Size, Screen Colors; Command Line Switches, & more.

HexView for Windows (freeware)

HexView is a multiple document Hexadecimal viewer that can display, print, and print preview any file as a hex dump. It is intended as a supplement for Search and Replace for Windows, however, it is a standalone app and does not require Search and Replace. A Japanese version is available.

Limit Edit (freeware)

Limit Edit expands upon the built-in limit feature for edit boxes & rich edit controls by letting you set your own maximum size settings for the amount of text permitted in edit boxes and rich edit controls. For example, Limit Edit can set a limit on the amount of text allowed in an instance of the Notepad text editor. The Limit Edit dialog also displays interesting information about the types of controls in use by a program. Although intended for edit boxes and rich edit controls only, it may also work on some other controls that are subclasses of these. Separate 16 and 32 bit version included.


File Open / Select Viewer Dialog Box

File Open/Select Viewer Dialog

File Name: Select or type the name of the document you want to open. This box lists documents with the filename extension selected in the List Files Of Type box. To see a list of files with a particular extension, type an asterisk (*), a period, a three-character extension, and then press ENTER. To see files with more than one filename extension, type a semicolon (;), a second asterisk (*), a period, and another three-character extension. For example, if you want to see all files with the .TXT extension and all files with the .INI extension, type *.txt;*.ini.

List files of Type: Select the type of files you want to see in the File Name list.

Directories: Select the directory where the files you want reside.

Drive: Select the drive where the files you want reside.

OK button: The file you selected will be used.

Cancel button: The file will not be used.


File Save Dialog

File Name: To save a document with a new name, in a different file format, or in a different location, type a new filename. To save a document with an existing filename, select the name in the list or type the current name.

Save files of Type: Select the type of files you want to see in the File Name list.

Directories: Select the directory where the files you want to search reside.

Drive: Select the drive where the files you want to search reside.

OK button: The file you selected will be used.

Cancel button: The file will not be used.


NO HELP2

No Help Available

No help is available for this message box.


Funduc Copyright

Search & Replace for Windows

Copyright © 1995-2010 Funduc Software, Inc.
All Rights Reserved www.funduc.com www.searchandreplace.com

See Ordering Information for details on how to purchase Search and Replace or write us at support@funduc.com. See License Information for details about licensing. For customer support, write support@funduc.com or visit our web site at www.funduc.com. Feature Suggestions? Write support@funduc.com. Also check our web site for product information, trialware & freeware downloads of our other award winning software products.


grep Def (P)

grep: The term 'grep' refers to a Unix command that searches files for lines matching a regular expression. It comes from syntax usage for the Unix qed/ed editor subcommand: "g/re/p", where 're' means regular expression, 'g' means globally search, and 'p' means Print the lines that contain matches.

There are other Unix variants:
- fgrep - searches for fixed strings only
- egrep - capable of extended regular expressions.

The advanced regular expression operators in Funduc Search and Replace are 'egrep' type operators.


Environment Variable Def (P)

Environment Variables are strings the operating system establishes, and uses, for various purposes. Individual programs can also set and use their own environment variables. To see what the current environment variables are, issue the 'SET' command from a command shell prompt. See you operating system documentation for more information.


Examples Index

The following are some of the examples available:


Favorites - Add to Favorites

The Add To Favorites prompt is activated from the Favorites menu on the toolbar.

To create a new Favorite:

1. Establish the Search, Replace, File mask / Paths options you want.

2. Select Add To Favorites from the Favorites Menu.

3. Specify a name to use in the prompt below. We suggest using a descriptive name to help you remember what the Favorite does.

4. Click on OK.

See Favorites Menu for more information.


File Operations Action (P)

Action: Select the action to take.

Important Notes:

  • A confirmation is offered for delete operations. Deletions are permanent. The program does not use the recycle bin. Delete with care!

  • This function can be used for file operations after script-based searches but full support for scripts using multiple file paths is not available. If you will be using File Operations after a script, please separate scripts into single path scripts.


File Operations Path Browser

Path Browser: Activates a standard Windows browser to let you select a destination path.


File Operations Cancel (P)

Cancel: Abort the operation.


File Operations - Delete Confirmation

A confirmation is offered before a delete operation with the File Operations dialog. Please use the delete carefully. Deletions are permanent. The program does not use the recycle bin.


File Operations Preserve Directory Structure (P)

Preserve Directory Structure: Check this to replicate the path structure of the files into the location specified on in the path field.


File Operations Help (P)

Help: Activates program help.


File Operations File List (P)

File List: The list of files highlighted in the Search Results list are displayed here. You may unselect one or more files if you like.


File Operations OK (P)

OK: Carry out the operation.


File Operations Path (P)

Path: Type in a destination path or use the browser button to the right of the field.


Filters - Invalid File Size

See Options-Filters. You probably have two size settings that are in the wrong direction. The larger value must be in the 'Greater Than' field.


Find In Search Results (P)

Find In Search Results: This allows you to search the Search Results list for a simple string. The string can differ from the search string used to generate the results list. This is also activated by pressing F3 when the focus is in the Search Results List.


Help Menu

The Help Menu functions includes choices to activate Search & Replace help, check for updates, and display the program About box.


NO HELP1

No Help Available

No help is available for this area of the window.


Search and Replace About Box

This window contains system and copyright information. The underlined link to our web site will launch the default www browser for your computer and take you to http://www.funduc.com. The underlined EMail link will launch the default Internet Email program for your computer. Click the Ordering Info button for Ordering Information or the License Info button for License Information.

For customer support, please contact us via Email at support@funduc.com.


File Operations

Search and Replace File Operations are available from the Actions Menu, the Context Menu, or by pressing the F2 key after a search had been performed. Highlight one or more strings or files in the Search Results list and activate File Operations.

You can drag n drop files from the File Operations dialog into any folder you want in Windows Explorer. The folder does not have to be the folder specified in the "Copy To:" field. Please note that drag n drop to Windows Explorer is a convenience function only. The program does NOT expand subdirectories. For example, if D:\Example\Directory_Toolkit.htm is dropped in the D:\Temp, the program does NOT create a D:\Temp\Example folder. This means you will need to be careful about name collisions. If you drag n drop both D:\Example\Directory_Toolkit.htm and D:\Example\OldFiles\Directory_Toolkit.htm into D:\Temp you will get a file change notice from Windows.

Additional Notes:

  • Files can be selected/de-selected in the File Operations dialog by highlighting or removing the highlight.

  • A context menu that includes a simple search function is available by right clicking on a file (see below).

  • Important: A confirmation is offered for delete operations. However, deletions are permanent. The program does not use the recycle bin. Delete with care!

  • This function can be used for file operations after script-based searches but full support for scripts using multiple file paths is not available. If you will be using File Operations after a script, please separate scripts into single path scripts.

  • Version 4.0+ has a special registry switch that can be used to specify the File Operations default target path.

Click on the graphic below for help on the dialog.

File Operations Dialog

File Operations Context Menu


Select Path Dialog Box

The Select Path Dialog provides a convenient way to select and insert a directory into the various "Path" lines. The dialog is a standard Windows path browser. For the Win 95/NT version, expand or contract directory by clicking on the [image] or [image]. Alternatively, you can use the arrow keys. For the Win3x version, click on the [image] or the [image] folder graphics. Click OK when done.

Win 95/NT Version

Win3x Version


Abort Script

Save Changes Confirmation?

Click on the Yes button to save the modifications. You will be prompted before overwriting any existing files. Click on the No button to abandon the modifications.


Include Exclude Masks Item 1

Include Exclude Mask List Item1: If this expression was highlighted, the string *.htm* would be visible in the "Files Matching" field to the right of the dialog. The "Include" and "All" radio buttons would be on.


Include Exclude Masks Item 2

Include Exclude Mask List Item2: The expression here makes use of the * wildcard operator to exclude all files in all subdirectories in all levels below the start path that begin with the string "_vti". When a specific file mask is not specified, *.* is assumed. For example, the subdirectory mask here, *.htm;~\*\_vti*\*\, is equivalent to *.htm;~\*\_vti*\*\*.*.


Include Exclude Masks Item 3

Include Exclude Mask List: The list of masks that will be inserted into the mask field when you click the OK button. Each expression here will be combined as a single expression separated by semi-colons.


Up Button

Up Button: Moves the highlighted mask in the Include/Exclude list up one step.


Down Button

Down Button: Moves the highlighted mask in the Include/Exclude list down one step.


Apply Button

Apply Button: Creates a mask in the Include/Exclude list for the data listed in the fields on the right side of the dialog.


Add Button

Add Button: Creates a new blank mask at the bottom of the Include/Exclude Mask list.


Insert Button

Insert Button: Inserts a blank mask in the Include/Exclude list above the highlighted line.


Delete Button

Delete Button: Deletes the highlighted mask in the Include/Exclude list.


Include Field

Include Field: Mark this to have the data in the other fields to the right of the dialog be an "include" mask.


Exclude Field

Exclude Field: Mark this to have the data in the other fields to the right of the dialog be an "exclude" mask.


Files Field

Files Matching Field: Enter either a specific filename or a wild card expression to use. The wildcard operators are the same as the DOS dir command, e.g., the ? and * characters may be used. "Files Matching" may be used alone to specify a general include or exclude file mask or it may be combined with data involving the "Directories Matching" field below to identify files in some directories but not others.


Directories Matching Field

Directories Matching Field: Enter a directory name or a wildcard specified directory name to use. The wildcard operators are the same as the DOS dir command, e.g., the ? and * characters may be used.


Directories All Field

All Field: Mark this to use only the data in the "Files Matching" field. The "All" field is mutually exclusive with the "Use Match" field. To use data in your mask from both the "Files Matching" and "Directories Matching", mark the "Use Match" field.


Directories Use Match Field

Use Match Field: Mark this to use an expression involving a subdirectory name specified in the "Directories Matching" field. The "Use Match" field is mutually exclusive with the "All" field. To use data in your mask from both the "Files Matching" and "Directories Matching", mark the "Use Match" field.


Directories Any Levels Field

Any Number of Levels Under Start Directory Field: a) Leave this unmarked to include (or exclude) the directory specified in the "Directories Matching" field that exists immediately under the start path directory. For example, given the staring path c:\test\, the expression ~\skip_me\ would skip the files in c:\test\skip_me\. However, files in c:\test\more\skip_me\ or c:\test\skip_me\test2\ would be processed. To also skip files in subdirectores under c:\test\skip_me\test2\, turn on the "Also Process Subdirectories" field.

b) Mark this to include (or exclude) the directory specified in the "Directories Matching" field no matter how many levels below the start path directory it exists. For example, the expression ~\*\skip_me\ would exclude the files in c:\test\skip_me\ and c:\test\more\skip_me\. Files in subdirectories under c:\test\skip_me\ and c:\test\more\skip_me\ that are not named "skip_me" would be processed, e.g., c:\test\more\skip_me\more2. To also skip files in 'more2', turn on the that "Also Process Subdirectories" field.


Directories Process Subdirectories Field

Also Process Subdirectories Field: Mark this field to include (or exclude) subdirectories below the directory specified in the "Directories Matching" field. For example, given the start path c:\test\ and the expression ~\skip_me\*\, all subdirectories under c:\test\skip_me\ would be excluded. Note that if "Also Process Subdirectories" was not checked (e.g., an expression such as ~\skip_me\), files in c:\test\skip_me\ would be excluded but files in c:\test\skip_me\test2\ would be included.


Include Exclude OK Button

OK Button: Inserts the items in the mask list into the File Mask field in the main dialog.


Include Exclude Cancel Button

Cancel Button: Close dialog without making changes.


Include Exclude Help Button

Help Button: Activates the online help.


Match Whole Word

Match Whole Word Flags

Match Whole Word is enabled/disabled via the Main Window Toolbar button or Flags Menu and the Script Editor . This switch determines whether Search & Replace will search for the exact word or phrase specified. A "whole word" is one that is enclosed by whitespace. For example, if this option is on and you search for "Window", the program will find it in the phrase "...use the Window menu..." but not in the phrase "...Windows 95...". If this option is not checked, both occurrences will be found. Note that Match Whole Word is not available when Regular Expressions are in use.


Search Path Explanation

Search Path

The path to search is specified in the Path field of Main Window or the Script Dialog. This is the upper level path where Search and Replace will begin search &/or replace operations. For example, to search fiiles in the folder, D:\HTML_FILES, type D:\HTML_FILES in the Path field.

Notes:

  • 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).

  • Use the file mask, filters, and advanced script settings to further specify which files will be processed.

  • 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.


Menus

For information on the program menus please see:


Not Operator Early Syntax

Not Operator Examples - Pre Version 3.1 Syntax
! | Not Operator: No match will be made if the expression is found. The NOT operator can be combined with other wildcard & subexpression operators. When combined with [], nothing in the range described in the brackets will be matched. For example,
 | !(b|c)at !(Windows )98 ![a-z ]98 | matches matches matches | at in "mat", "rat" or "fat" but not in "bat" or "cat" 98 in "1998" but not in "Windows 98" 98 in "1998" but not in "Windows 98"


Changes In "Not" Operator Syntax

The Regular Expression 'not' operator, !, was revised in Search and Replace version 3.1 to improve reliability and predictability of ! expressions. Longtime Search and Replace users may have noted in the past that when ! was combined with other operators it was sometimes difficult to anticipate what aspect of the total expression would be affected by the ! character. The syntax for ! is now explicit and, we hope, easier to understand & debug.

Previous users should familiarize themselves with the new syntax. Previous ! syntax may not work as it did before and existing scripts may need revision.

In general, the ! syntax now requires explicit expressions for both the string(s) to be found and the string(s) to not find. This can be thought of as "find something except what is specified by the ! expression".

For example, under the older syntax, to find "mat", "rat" or "sat" except in "bat" or "cat", the expression was !(b|c)at. Now the expression would be ?at!((b|c)at). In words, this can be thought of as "find something ending in 'at' except if it ends in 'b'at or 'c'at.

See ! - Not Operator for additional examples.

Notes:

  • In most cases you will need to specify a wild card operator of some type in the component of your expression representing the 'positive' hit. Referring to the above, the ? is necessary. You could also use any of the other operators.

  • The 'not' component of the expression should be enclosed in ( ) or [ ]. Complex expressions may included inside the paren or brackets.

  • !() may be employed as a type of "and" operator. For example, div*!()(center|right) will work.

  • When using ! with replacements be sure to specify the search expression literals in your replacement expression. For example, if you employed the search expression ?at!((b|c)at) in a replacement to put quote characters around all strings ending in 'at' (except if they begin with 'b' or 'c'), the replacement expression would be "%1at". The 'at' string must be specified in the replacement expression because that is a literal in the search expression.

  • The components of the expression following the ! operator may not be accessed via an %n operator in a replace string. For example, in the expression div*!()(center|right) there would be no %2 operator for use in a replace expression.


Case Sensitive Flag

Case Sensitive: The Case Sensitive flags in the Main Window and the Script Editor determine whether Search & Replace will perform an exact case search (& replace). Note that if you want a replacement to be case sensitive, you must define a case sensitive search.


Copy to Clipboard Button

Copy to Clipboard: Copies the search results to the clipboard. This is the same as pressing CTRL-C anywhere in the Search Results list.


Customize Toolbar Launch Area

Customize Toolbar: Launch the Customize Toolbar dialog by right clicking on the toolbar area of the main dialog.


File Masks (P1)

File Masks:

File Masks are file name filters, which, in conjunction with the search path, filters, and any advanced script settings, define the files Search and Replace will operate on. File masks and wildcards can also be files and subdirectory names to create complex file mask expressions that include files in some subdirectories while excluding those in others. The mask wildcards characters of * and ? are those used in the DOS dir command, e.g., *.*;*.txt;*.doc;*.??1. More than one mask can be specified by using a semicolon separator (see above). One or more specific files can be searched by entering the file name(s) in the file mask field and the path in the Path field. Separate multiple names with the ; character, e.g., index.html;searchthis.htm.

You can also drag n drop files from Windows Explorer into the file mask field. Folders can be drag n dropped from Explorer into the Path field.

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 on the main screen. Be sure not have any blank spaces between the semicolon(s) and the mask(s).

Search and Replace saves your last few file masks in the combo box list ( [image]) to the right of the File Mask field.

Include Masks: These are the masks as outlined above. For example, to include all files of the filetype .html in a search, you would use the mask *.html. Of note, if you wanted to also include .htm files, you could use the mask *.htm* or use a semicolon separator and create two masks, *.html;*.htm. See complex file masks for help on adding mask expressions involving subdirectories.

Exclude Masks: the ~ character denotes a mask NOT to search. For example, if you wanted to exclude all .exe and .dll files from your search, you would use the mask *.*;~*.exe;~*.dll. Here, all files but .exe and .dll files would be included. Note the use of the semicolon separators. See complex file masks for help on adding mask expressions involving subdirectories.

To specify the ~ character as an explicit part of a filename, use \~ to denote the literal. For example, a mask to include the files named ~1.txt and ~2.txt would be \~*.txt. To create an exclude mask for those files, use the mask, ~\~*.txt.


File Operations Button

File Operations: Click to launch the File Operations dialog.


Filter Options Explanation (P)

Filter Options: Filter Options are used to set file date, file size, and attribute criteria for files to include or exclude from your search &/or replacements. Filters are used in conjunction with search paths, file mask, and advanced script settings to specify which files will be processed.


LFCR

Note: \r\n - DOS line end, cr-lf sequence
\n - Unix line end character
\r - MAC line end character


Help Button

Help Button: Activates the program online help.


View As HTML Button

View As HTML: Send the Search Results to an automatically generated HTML file and launch your default web browser.


HTML Mode Button

HTML Mode: Activates HTML Mode.


File Mask Browser

File Mask Editor: Activates the Include/Exclude Files & Directories dialog, which you can use to assist you in constructing complex file masks.


Match Whole Word

Match Whole Word: The Match Whole Word flags in the Main Window and the Script Editor determine whether Search & Replace will search for the exact word or phrase specified. A "whole word" is one that is enclosed by whitespace. For example, if this option is on and you look for "Window", the program will find it in the phrase "...use the Window menu..." but not in the phrase "...Windows 95...". If this option is not checked, both occurrences will be found. Match Whole Word is not available when Regular Expressions are in use.


Exclude After Date (P)

Exclude After Date: When 'Reverse Filters' is disabled, files dated after the date specified are excluded. Enabling 'Reverse Filters' has the opposite effect - only files after the date specified are included. You may combine this setting with a 'Before Date' to limit operations to a specific date range. Date exclusions can also be combined with one or both of the exclude by size filters. See Size and Date Filter Examples for some samples.

You can also enter the special token - %%today%%. This code is intended for manually edited scripts and not the GUI, but it does work. The program converts the entry to either the current date or the value calculated. For example, if you enter %%today-10%% and the current date is March 17, 2003, the program will convert this to March 27, 2003.

Note: If you need to 'filter' files by file name or path, use the Complex File Mask dialog.


Attributes (P)

Attributes: Select one (or more) attribute-types to exclude from your operation.

Dim: The attribute is not considered in any filter.

Checked: Files that do not have the checked attributes will be included. For example, to do an operation on files that do not have archive set, check 'Archive'. To list files that are not 'ah', check 'Archive' and 'Hidden'. The checked attributes are 'ANDed', meaning all the checked attributes must be present. For example, when 'Archive' and 'Hidden' are checked, 'a', 'h', 'ar', 'as' are listed but 'ahr' or 'ah' are not.

Unchecked: Files having that attribute in combination with any other unchecked attribute are included. For example, to include 'a' and 'ro', uncheck 'Archive' and 'Read Only'.

Combinations of Checked and UnChecked: Checked and unchecked creates an 'OR' relationship between the checked and unchecked items. For example, 'Archive' unchecked and 'Read Only' checked eliminates 'r' from the operation that are either 'r' alone or do not have 'a' involved as well. This means that 'rsa' files would be included but not 'rh' files. To continue, if 'Archive' is unchecked and both 'Read Only' & 'Hidden' are checked, files that are both 'rh' are eliminated except for files that also include 'a'.

Notes:

  • Attributes have many possible choices and combinations of checked/unchecked can be confusing. A 'dim' check in all attributes fields and Reverse Filters off (unchecked) is the program default. If you need to return to baseline, make your settings appear like they do in the graphic here.

  • When Reverse Filters is disabled checked choices originate from the perspective of an 'exclude' filter. For example, if 'System' alone is checked, all 's' files are excluded. If 'System' and 'Read Only' are checked, files that are 'sr' in some way are excluded.

  • See Filters - Attribute Examples for some sample settings.

  • If you need to 'filter' files by file name or path, use the Complex File Mask dialog.


Exclude Before Date (P)

Exclude Before Date: When 'Reverse Filters' is disabled, files whose date stamp precedes the date specified are excluded from the operation. Enabling 'Reverse Filters' has the opposite effect - files preceding the date specified are included. You may combine this setting with a 'Before Date' to limit operations to a specific date range. Date exclusions can also be combined with one or both of the exclude by size filters. See Size and Date Filter Examples for some samples.

You can also enter the special token - %%today%%. This code is intended for manually edited scripts and not the GUI, but it does work. The program converts the entry to either the current date or the value calculated. For example, if you enter %%today-10%% and the current date is March 17, 2003, the program will convert this to March 27, 2003.

Note: Use the Complex File Mask dialog to 'filter' files by file name or path.


Exclude Files Less Than (P)

Exclude Less Than: When 'Reverse Filters' is disabled this field excludes all files smaller than the value entered. Enabling 'Reverse Filters' has the opposite effect - only files smaller than the value entered are included. Size units may take the form of # of bytes or whole K, KB, or M values, e.g., 100K, 100KB, 1M, 4M. Do not enter fractional values when using K, KB, M quantities. This field can be combined with a value in the 'Larger Than' field and one or both of the date filters. See Size and Date Filter Examples for some samples.

Note: Use the Complex File Mask dialog to 'filter' files by file name or path.


Exclude Larger Than (P)

Exclude Larger Than: When 'Reverse Filters' is disabled this field excludes all files larger than the value entered. Enabling 'Reverse Filters' has the opposite effect - only files larger than the value entered are included. Size units may take the form of # of bytes or whole K, KB, or M values, e.g., 100K, 100KB, 1M, 4M. Do not enter fractional values when using K, KB, M quantities. This field can be combined with a value in the 'Less Than' field and one or both of the date filters. See Size and Date Filter Examples for some samples.

Note: Use the Complex File Mask dialog to 'filter' files by file name or path.


Filter Reset Button (P)

Reset Button: Click this turn off all filter settings by resetting the fields back to the defaults.


Reverse Filters (P)

Reverse Filters: Reverse Filters is used to make the Minimum & Maximum Size, Minimum & Maximum Date, and File Attribute settings work as 'inclusive' filters. Dim vs. Checked vs. Unchecked for Attribute choices work in a similar fashion to when Reverse Filter is off except that logic works toward including files instead of ruling them out.

For example, Reverse Filter = On, 'Archive' & 'System' checked includes files that are 'as' in some way. If Reverse Filter = Off, no 'as' files are listed.

To continue, Reverse Filter = On, Minimum Date=11/01/2002, Maximum Date Filter=11/30/2002, and 'Archive' is checked, 'a' files 10/31/2002 or earlier AND those 12/1/2002 or later will be included.


Auto Complete Combo Boxes (P)

Auto-Complete Combo Boxes: Check this to enable "fill-as-you-type" for the Search, Replace, File Mask, and Path fields in the main dialog. When enabled, if you type characters matching a string in the history list for that field the entry expands automatically.


File Color

File Color: Activates a Color Dialog to change the highlighting color of file names in the Search Results area.


Found Color

Found Color: Activates a Color Dialog to change the highlighting color of found strings in Search Results and the View Context windows.


Number of Items to Save

Number of Items to Save: This setting controls the number of items Search and Replace will save in the drop down lists ( [image]) next to the Search & Replace strings, File Mask, & Path fields. The default is 5. The maximum is 20.


Lines To View

Lines To View: This setting controls the number of lines displayed in View Context window. The default is 5 and the maximum 20.


Selected Hit Color

Selected Hit Color: Activates a Color Dialog to change the color to use for the selected hit. Adjustments here can be helpful if you are working on a LCD display and the standard highlight color obscures color used the search hit.


After Hit Character(s) (P)

After Hit Character(s): Enter the string to use to demark the end of the search hit in clipboard dump or in the output file. Blank out this field if you want no demarcation.


Append to Output File (P)

Append to Output File Enable this to write to the output file in 'append' mode. If the file exists, existing content is preserved. When this box is not checked, the output file is replaced each time.


Before Hit Character (P)

Before Hit Character(s): Enter the string to use to demark the start of the search hit in clipboard dump or in the output file. Blank out this field if you want no demarcation.


Binary Line Prefix (P)

Binary Line Prefix: This field can be used to modify the line prefix when Display First Hit Line is enabled and the file being searched is binary. The default string is Offset 0x%-6lx -. Please see Line Prefix Switches for details about making change to this setting.


Display File Size and Date/Time (P)

Display File Size and Date/Time When checked, the display lists the file size and date stamp of the files searched.


Display First Hit Line (P)

Display First Hit Line: When checked, the display lists filenames and the highlighted context of where the search string was found. If you are searching across multiple lines, the first line of the "hit" will be displayed. Note that if this is the only box checked, you will only get feedback from files where the search string was found.


Display Number of Hits (P)

Display Number of Hits: When checked, the display lists the filename(s) and number of times the search string was found in that file. Note that if "Display First Hit Line" is not checked, the only thing listed will be the number of hits. Select this if you only want to know how many hits were found in each file.


Display Files Without Hits (P)

Display Files Without Hits: When checked, the display lists the filenames where no occurrences of the search string were found. Note that if this is the only box checked, the display will not list files were the search string is present.


Display Replacement String (P)

Display Replacement String: When checked, the display lists the filenames, replacements, and total counts for all replacements. Note that if this is the only box checked, you will not see the context of each replacement. Check "Display First Hit Line" if you want to see the full replace contexts.


Test Line Prefix (P)

Test Line Prefix: This field can be used to modify the line prefix when Display First Hit Line is enabled. The default setting is Line %3ld -, which results in out such as Line 20 - , Line 12984 - , and so on. The syntax for changes somewhat complex. Please see Line Prefix Switches for details.


Write Replacement Output To File (P)

Write Output To File: To route the contents of the Search Results list to a file, enter a file of your choice in this field. If this field is blank, no file is produced. If no path is specified, the current directory is used. Use the Browse button ( [image]) to the right of the field to select an output file via a File Save As dialog. The default name suggestion is "Results.txt.". Supply another name if you want. The contents are the same as Note that what is written to this file is the same information presented in the Search & Replace results display. Therefore, to adjust the output, make selections in the "Hit Line Display" checkbox fields.

Notes and Additional Functions:

  • To dump the search results directly to the Windows clipboard, specify "clipboard" (no quotes) in this field. Clipboard contents are overwritten with each new search (or replace). To turn off the clipboard dump, blank out the field.

  • To route the search results to your printer, enter the phrase "Default Printer" (case insensitive, no quote characters) in this field. Long lines will be word wrapped in the printed output. To turn off printing, blank out the field.

  • To output the file contents in html format, specify '.htm' or '.html' as a name extension for the output file the program writes. The formatting is similar to the results you see from the 'View as HTML' function.

  • See the Copy Search Info to Clipboard switch in Options|Display to control whether or not search parameters are included in the output report.


Copy Search Info To Clipboard (P)

Copy Search Info To Clipboard By default, if one or more lines are highlighted in the Search Results list and Ctrl+C is used to copy to the clipboard, the program includes information about the Search/Replace strings, Mask/Path, and special settings. Uncheck this switch to copy only the highlighted lines and not include details about search parameters. You may need to restart the program for changes to take effect. This switch has a similar impact on the material included in the output report (if enabled). See Options|Output.


Show Hits on Separate Lines (P)

Show Hits On Separate Lines By default, each hit is shown on a separate line in the search results. When disabled, if there are multiple hits on a line the line is listed only once.


File Association

If no association use: Enter the default viewer to use when: a) a file has no Windows file association on your computer or b) when you select the Search & Replace default viewer. You may also use the Browse button ( [image]) to select a default viewer via the Select Viewer dialog. Search and Replace can pass the following variables on the command line:

%path% - Full file path to the file

%line% - Line number of the search hit.

See External Editors for more information and some sample command lines.


Binary Editor (P)

Binary Editor:

Enter the hex editor/viewer to use instead of the Search and Replace internal context viewer when a search hit is in a binary file. Search and Replace can pass the following variables to the command line:

%path% - full file path to the file

%start% - offset of first found character

%end% - offset of last found character

%length% - length of found string

See External Editors for more information and some sample command lines.


Cache File List (P)

Cache File List: Search and Replace normally caches the file names in the search path during the first file search. This saves time for paths that contain many files but may cause new files to be missed during subsequent searches in that same path. Unmark this box to have the program refresh the file list with each search/replace operation.


Double-click On Line Action (P)

Double-click On Line Action: The four choices in the drop down list ( [image]) determines the response to a double click on a search hit line in the Search Results list. The choices are:

  • View Context (default): The Internal Context viewer is opened.

  • Open With Associated Viewer: The editor/view associated with the filetype according to your windows installation is used.

  • Open with Default Viewer: The editor/viewer specified in the If no association use field is used.

  • File Operations: The File Operations dialog is displayed.


Collapse Results Branches (P)

Collapse Results Branches Enable this to have the initial search results tree appear in a collapsed state. You can expand it with the mouse or one of the keyboard shortcuts.


Favorites Path (P)

Favorites Path: Specify here the path to use for storing Favorites. You can change this to another path if network permissions will not be an issue for you. Check with your network administrator if you have questions about access permissions.


View Context Font (P)

View Context Font: Activates a font selector dialog to pick a new font for the View Context dialog.


Single Instance Mode (P)

Single Instance Mode:

When checked, only one instance of the program can be launched. When not checked, instances are identified:2, :3 etc in the window title so they can be distinguished in the Windows Task Bar and ALT-TAB switcher.


Quiet Mode (P)

Quiet Mode Silences all error messages. This is for advanced use only, when you are very sure you do not need to see warnings about replacements in binary files or file locking reports. Enable this only if you are sure you need it! We suggest you use it for specific tasks and then return the program to normal mode when you are through with that task/project.


Process Binary Files (P)

Process Binary Files By default, if your File Mask or Filter setting do not limit searches otherwise, the program searches all files. To not search 'binary' files, uncheck this switch. When not checked, if the program determines a file is 'binary' it will not be searched. That file will still be listed in the Search Results but zero hits will be indicated.


Show Progress Meter (P)

Show Progress Window Enable this to display the progress meter.


Scroll Results (P)

Scroll Results Enable this to have the Search Results List scroll automatically as an operation is performed.


Show Results in Tree (P)

Show Results in Tree Enable this to activate the tree style in the Search Results list.


Options Help Button

Help Button: Activates online help.


Options OK Button

OK Button: Saves the current settings and closes the dialog.


Backup Path (P)

Backup Path: Enter a backup path to use if you want Search and Replace to backup the originals of any files changed during a replace operation. You may use the Browse button ( [image]) to select a path via a Select Path dialog. If Search Subdirectories is turned on, the directory tree of the original path is created as necessary during the Replace operation.


Write Output to Backup Path (P)

Write Output to Backup Path: Check this box to write the files changed during a replace operation to the directory specified in the Backup File Path field. This will leave the original file(s) in the search path unchanged. If Search Subdirectories was checked, the directory tree of the search path will be created as necessary under the path specified in Backup Directory. Note that if you check this, you need to remember that the newer, replaced versions of your file(s) will be in the Backup Directory. Search & Replace provides a reminder message when "Write Files to Backup Path" is checked.


Replace Processing (P)

Replace Processing: Use this set of mutually exclusive radio choices to apply (or not) Special Case Handling during replacements. Please see Special Case Handling for more information and examples.

  • None: None: Standard mode. No special letter case changes made.

  • Capitalize All Words: The program capitalizes 'words' while making the replacement. For example, if the search string is coffee or tea and the replace string is bitter or sweet, the replace would be Bitter Or Sweet. This can be used with regular expression mode.

  • Match Capitalization: If the letter case of the existing text found is consistent within "words" the program will match the overall capitalization of the search hit and apply that while making the replace. For most searches this means if the first two alphabetic characters of the first 'word' is lower case, the replace will be lower case and visa versa. If the 1st is capital and the 2nd is lower, the replace case is 1st letter cap, remainder lower. If the search and replace strings differ in length, the pattern detected in the search will be continued forward replace string. This can be used with regular expression mode.


Do not chage file date/Time (P)

Do Not Change File Date/Time: When enabled, Search & Replace preserves the original time & date stamp of files when replacements are made.


Replacement Prompts (P)

Replacement Prompts?: This mutually exclusive selector controls whether or not Search and Replace will supply prompts during replacement operations.

  • Select "Prompt On All" for prompts on every string to be replaced in every file.

  • Select "Prompt on Each File" prompts for the total number of occurrences in each file. The Replacement Confirmation dialog is not presented with this option.

  • Select "No Prompts" for no prompts whatsoever for all replaces. Note that If you use this option, you may not realize the exact context of every string you replace or which files you replace them in until after the operation is finished.

Note: If you are using an Advanced Script operation, read over the help section on Replacement Prompts for details about the behavior of replacement prompts and Advanced Scripts.


Buffer Size (P)

Buffer Size: Buffer Size is the size (in bytes) of the memory block used by the program when reading files. The default is 102400. The lowest value permitted is 32768. In most cases you should leave this setting at the default. This setting is primarily used to speed up searching in combination with the Stop Processing After First Hit in File switch or the special registry switch - Num Buffers To Process. In most other cases setting this field to a lower or higher value will NOT result in faster searching. Low values may actually increase search time because the program will have to perform more separate file reads on a given file.


Maximum Chars (P)

Maximum Chars: Enter a value to determine the maximum number of characters displayed on the first hit line in the Search Results list. The range is 128-4096 characters. Exit and restart for changes to take effect.


Maximum Regular Expression Size (P)

Maximum Regular Expression Size: Enter the maximum number of bytes to allow for regular expression searches . The maximum allowed is 32767 (32K) or 1/2 the size specified in the Buffer Size field. If you have many search & replaces involving simple expressions, smaller values here may speed up operations. Conversely, if you have a regular expression search that involves Binary Characters and/or is very complex, larger values will be necessary.


Sort Search Results By (P)

Sort Search Results By: Make a selection to use for the order files are listed in the Search Results list &/or Output File. Check the 'Ascending' box to use an ascending list. The choices in the [image] combo list are: Unsorted, File Name, File Extension, File Date/Time, File Size, and File Path. Unsorted means files are listed in the order they are found according to your file systems.


Stop Processing After First Hit (P)

Stop processing after first hit in file: For search-only operations, when this is checked the search will move on to the next file in the path, mask, & filter criteria after the first hit is found in a file. This is useful for quickly narrowing down files if you have a lot of data to search. For search & replace operations, when this field is checked and Replacement Confirmations are enabled, selecting the "Replace This" prompt will cause the search & replace operation to make that one replacement and then move to the next file. Selecting any other replacement prompt will cause all replacements to be made in that file before processing moves to the next file.


UnZip Path (P)

UnZip Path: Enter a path (or use the browse button - [image]) to temporarily extract ZIP files to for searching when "Search ZIP files" is turned on. The default is the temporary directory defined by your computer's operating system, typically "Windows\Temp". Subdirectories will be created and removed as needed under the specified path.


Options Cancel Button

Cancel Button: Closes the dialog and cancels any changes made.


Search Path Explanation (P)

Search Path: The search path in specified in the path field of the Main Window or the Script Dialog. This is the upper level path where Search and Replace begins the search &/or replace operations.

Notes:

  • 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).

  • Use the file mask, filters, and advanced script settings to further specify which files will be processed.

  • 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.


Print Button

Print: Print the Search Results.


Regular Expression Also See Popup 1

Regular Expression Replacement Operators
Regular Expression Examples
Regular Expression Counter Operators
Special Replacement Operators


Regular Expressions Also See 2

Regular Expression Search Operators
Regular Expression Examples
Regular Expression Counter Operators
Special Replacement Operators
Special Replacement Operators


Regular Expressions Also See Popup 3

Regular Expression Search Operators
Regular Expression Replacement Operators
Regular Expression Counter Operators
Special Replacement Operators


Regular Expressions Also See Popup 4

Additional Regular Expression Search Examples
Search and Replace Regular Expression Examples
Regular Expression Search Operators
Regular Expression Replacement Operators
Regular Expression Incrementing Counters
Special Replacement Operators
Additional Regular Expressions Search Examples


Regular Expressions Also See Popup 5

Some Basic Regular Expression Search Examples
Search and Replace Regular Expression Examples
Regular Expression Search Operators
Regular Expression Replacement Operators
Regular Expression Incrementing Counters
Special Replacement Operators


Regular Expressions Also See Popup 6

Basic Regular Expression Search Examples
Additional Expression Search Examples
Regular Expression Search Operators
Regular Expression Replacement Operators
Regular Expression Incrementing Counters
Special Replacement Operators


Regular Expressions Also See Popup 7

Regular Expression Search Operators
Regular Expression Replacement Operators
Regular Expression Examples
Special Replacement Operators
Number Parsing and Math Operators


Regular Expressions Replacement Literals

Regular Expression Replacement Literals: % \ < > must be preceded by the \ character to be interpreted as literals in a regular expression replacement. See Regular Expressions - Literals for more information.


Regular Expression Search Literals

Regular Expression Search Literals: - + * ? ( ) [ ] \ | $ ^ ! must be preceded by the \ character to be interpreted as literals in a regular expression search. See Regular Expressions - Literals for more information.


Replace Confirmation - Found String

Found String:

The list at the top of the confirmation dialog provides information about the replacement context. Replacement strings are always listed. If you have 'Display First Hit Line' enabled in Options-Output, the search hit line will be listed. Double click on the search hit to display the View Context dialog and see more of the context of the pending replacement. You can also highlight one or more lines in the dialog and copy them to the clipboard with CTRL+C or from the mouse right click menu.


Replace Confirmation - Replace String

Replacement String:

The replacement string is listed here. If you have 'Display First Hit Line' enabled in Options-Output, the search hit line will be listed above. Double click on the search hit to display the View Context dialog and see more of the context of the pending replacement. You can also highlight one or more lines in the dialog and copy them to the clipboard with CTRL+C or from the mouse right click menu.


Replace This Button

Replace This:

This single occurrence of the string will be replaced. The next prompt will be for the next hit, if any.


Replace Rest of File

Replace Rest In File:

The pending replacement and all other occurrences in the current file will be replaced. The next prompt will be in the next file, if any.


Replace Rest of Directory

Replace Rest In Directory:

The pending replacement and all occurrences in all files in the same directory as this file will be replaced. The next prompt will be for the first file in the next directory, if any.


Replace All Remaining

The pending replacement and all other occurrences in all files to be processed will be replaced. No more prompts will be offered until the end of the operation.


Skip This

This one replace will not be skipped. The next prompt will be at the next hit, if any.


Skip Rest of File

The pending replacement and all others in the current file will be skipped. The next prompt will be for the next file, if any.


Skip Rest of Directory

Skip Rest In Directory:

The pending replacement and all others in the remaining files in the directory will be skipped. The next prompt will be for the next file in the next directory, if any.


Cancel Remaining

Abort the entire operation. The pending replacement and all others will be canceled.


About Button

About: Click this to view system information, Ordering Information and License Information .


Actions Menu Jump (P)

Actions Menu: See Actions Menu for more information.


Binary Editor

Binary Editor: These buttons activate the Binary Mode dialog for the corresponding search & replace string fields. Binary Mode is used to search or replace across multiple lines or enter special characters in the search or replace fields. If you create a string using binary mode input, "Binary mode -->>" is displayed on the respective Search &/or Replace string lines. To revise or check your entry, click on this button again.

If you are doing a Search & Replace operation, it is OK to have one component as a "binary mode" string and the other as a regular string (or even a blank string).

Press CTRL+Binary Mode button to quickly insert the current search/replace string into the respective binary mode dialog.

Note: If you have a search/replace where you want to span one or more lines but are not concerned with CR LF's or Tab's per se, consider using the *[] regular expression search operator.


Path Browser

Path Browser: Click to activate the select path dialog.


Case Sensitive Search Field

Case Sensitive: Select this for case sensitive search/replace. Uncheck it if you want to search regardless of case. For case sensitive replacements you must define a case sensitive search.


Script SR List Add (P)

Search/Replace Add Button:

Click this to add the line to the bottom of the list.


Script Advanced Settings Description

Script Description: Enter comment text of your choice.


Script Advanced Settings Expression Evaluator

Process File When Expression is Non-Zero:

This field is the boolean "Expression Evaluator", which is used to determine which files among those meeting the file mask, path, and filter criteria are ultimately processed by your script. The variables in this field are labeled E1, E2 ... En, where n is the number of search/replace strings in your script. Under the default OR expression (e.g., E1 OR E2) all files meeting the file mask, path, and filter criteria would be processed - If a search string makes a hit, that search (or replace) will occur. Other combinations of operators and variables in the expression allows you to process only certain files within the domain of possible files according to your path, file mask, and filter criteria. When the result of the expression is non-zero, a file will be processed.

The field may contain: a) the AND OR NOT < > <= >+ = != + - * / operators, b) E1, E2, E3,... En to denote the search & replace string pairs in the script, c) numeric values denoting the number of replacement opportunities for a variable (e.g., E2 >= 1), d) comparisons of the numeric values of the number of replacement opportunities (e.g., E1 AND (E2 != (E3))), and, e) arithmetic expressions on the values of the En variables (e.g., (E1 + E2) = (+5)).

Important Note: When making replacements the 'Process File When Expression is Non-Zero' comes into play after all search hits have been accumulated. When making replacements you will receive replace confirmations (if replace confirmations are enabled) for all places where a search hit exists for a given search expression even though the 'Process File When Expression is Non-Zero' field may rule out that replace once all the search hits are collected. Do not be alarmed! This is for debugging your search terms. When you are satisfied that your search terms are finding what they should find you must answer 'Replace This' or 'Replace All' to replacement prompts in order for 'Process File When Expression is Non-Zero' to be applied properly. The expression is based on 'replacement opportunities'. If you rule out a replacement opportunity by answering 'No' to a replace confirmation you may affect the final assessment by the 'Process File When Expression is Non-Zero' file. Please see Expression Evaluator and Replacement Prompts for more detail. Also see Expression Evaluator for details.


Script Advanced Settings Options Button

Script Options Button: Opens an abbreviated Options Dialog you can use to specify settings for the script. The Options-General tab is not available here because those settings are not needed during scripted operations.


Script Advanced Settings Options Checkbox

Use Program Options Checkbox: When checked, the script uses the Options in effect for Search & Replace. When unchecked, the script overrides the Options settings and uses changes you make via the Options Button to the left of this field. To remove all options from a script and use the current program settings instead, check this field.


Script Advanced Settings Search Subdirectories

Search Subdirectories Checkbox: By default, scripts follow the "Search Subdirectories" settings on the Main Window. Check this box if you want your script to search subdirectories regardless of the setting in the Main Window. This field is dim if "Use Program Options" is checked.


Script Advanced Settings Repeat Action

Repeat Script This is the Script Loop operator. This setting affects the entire script. The default value is 1. To repeat the entire script more than once, select a new value.


Script Advanced Settings OK Button

OK Button: Closes the Advanced Script Settings dialog.


Script Advanced Settings Cancel Button

Cancel Button: Cancels any changes. The ESC also closes the dialog.


Script Advanced Settings Help Button

Help Button: Activates the help topic for the Script Editor.


Script SR List Apply (P)

Search/Replace Apply Button: Click this to commit the information for the highlighted search/replace line to the script.


Script SR Binary (P)

Binary Mode Button: Click these buttons to activate the Binary Mode dialog for the respective Search or Replace strings. The Binary Mode dialog is used to for operations that span multiple lines or use special characters. When you are done, "Binary mode -->>", is displayed in the string area. To double check your entry or make changes, click the button again. Be sure to click the Search/Replace "Apply" Button to enter your changes into the script. Special Replacement Operators may be combined in binary operations.


Script Case (P)

Case Sensitive: Check this if you want the search to be case sensitive. Uncheck it if you want to search regardless of case. To save the information for the current line, click the Search/Replace "Apply" Button.


Script SR List Comment (P)

Comment Button:

Click here to add a comment to the highlighted Search &/or Replace string.


Script Path Add (P)

Path/Mask Add Button:

Click this to add the current line to the bottom of the list.


Script Path Apply (P)

Path/Mask Apply Button: Click this to commit the information for the highlighted selected line.


Script Path Browser (P)

Path/Mask Browse Button: Click this to use the path browser to select the path where files to search reside. If the Path field currently contains a valid path, it will be your starting path in the dialog. Otherwise, the current path will be used.


Script Cancel (P)

Cancel Button: Exits the dialog without using the script settings. If you made changes to a script, a confirmation box asks you whether you want to save the information. The ESC key also cancels.


Script Path Down (P)

Path/Mask Move Down Button: Click this to move the highlighted line Path/Mask list down by one.


Script Path Insert (P)

Path/Mask Insert Button: Click this to insert a new Path/Mask line above the highlighted line.

To quickly insert the current path/mask entry from the main dialog without deleting the other entries, hold CTRL and click on "Insert".


Script Load (P)

Load Button: Click this to load an existing script from disk for use &/or editing.


Script Mask (P)

File Mask field: This is the file mask for the search/replace that is currently highlighted in the Search/Replace list (if any are present). 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 ZIPs as well as ordinary files in the path specified in the path field. To save the information for the current line, click Path/Mask "Apply" Button.


Script Path (P)

Path/Mask Path field: This is the path for the search/replace that is currently highlighted in the Search/Replace list (if any are present). You may type a path by hand or navigate to it by using the Browse button ( [image]). You can use Complex File Mask expressions to further specify which files in the path will be processed by the script. You can also use the Advance Script Options button or the Options button on the Search and Replace main window to establish Filters to further specify the files to be processed. Click the File/Path "Apply" button to commit your choice to the script.


Script Path List (P)

Path/Mask List: The list of path/mask combinations established for the current script. Two assignments are listed here. To change an existing assignment, highlight it in the path/mask list, make changes on the File Mask(s) or Path lines, and click on Apply.


Script Path Remove (P)

Path/Mask Remove Button: Click this to delete the information for the highlighted line.


Script Path Remove All (P)

Path/Mask Remove All Button: Click this to remove all the Path/Mask lines.

To quickly delete the existing script mask/path settings and insert those from the main dialog, press the CTRL key as you click on this button.


Script Save As (P)

Save As Button: Click this to save the created/modified script to disk via a standard Save As dialog.


Script Path Up (P)

Path/Mask Move Up Button: Click this to move the highlighted line in the Path/Mask list up by one.


Script Use (P)

Use Script Button: Click this button to use the script for Search, Search and Replace, Touch or File Find. You can override several of the script settings in the main window (see Scripts for details).


Script HTML Mode (P)

HTML Mode: Check this to use HTML Mode. Click the "Apply" button to save the setting for the current line. HTM Mode is not available when Regular Expression is checked.


Script Ignore Whitespace (P)

Ignore Whitespace: Check this to use Ignore Whitespace mode. To save the setting for the current line, click the Search/Replace "Apply" Button. Ignore Whitepace is normally not available when Regular Expression is checked.


Script Incl Excl Dialog (P)

File Mask Dialog 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 inserted into the file mask field.


Script SR List Insert (P)

Search/Replace Insert Button: Click this to insert a new Search/Replace line above the currently selected line.

To quickly insert the current search/replace entries from the main dialog without deleting the other entries, hold CTRL and click on "Insert".


Script SR List Down (P)

Search/Replace Move Down: Click this to move the information for the highlighted line down by one line.


Script SR List Up (P)

Search/Replace Move Up: Click this to move the information for the highlighted line up by one line.


Script SR Reg Exp (P)

Regular Expression: Check this field use a regular expression search &/or replacement. Case sensitive and binary mode may be used in conjunction with this type of search. See Regular Expressions for more information on the syntax supported. To save the information for the current line, click the Search/Replace "Apply" Button.


Script SR List Remove (P)

Search/Replace Remove Button: Click this to delete the information for the highlighted search/replace line from the script.


Script SR List Remove All (P)

Search/Replace Remove All: Click this to remove all the existing Search/Replace combinations.

To quickly delete the existing script search/replace strings and insert those from the main dialog, press the CTRL key as you click on this button.


Script Replace String (P)

Replace String: Enter replacement string in this field. The string you enter can be a simple replacement, a regular expression (be sure to check the 'Regular Expression' checkbox), or a replacement involving special replacement operators. To create a binary replacement using special characters, click the [image] button to the right of this field. If you create a Binary replacement, the string, "Binary mode -->>", is displayed in the replace string field. When you are done with this field, the Search string and the Case Sensitive, Regular Expression and Match Whole Word settings, click "Apply" to save the information to your script. Special Replacement Operators are valid in script replacements strings.

Note that in the current example, the highlighted line in the Search/Replace list makes use of Regular Expression replacement using the %1 operator to include the search results yielded by the * search operator (see the Search String) in the replacements.


Script Search String (P)

Search String: Enter the string to search for in this field. The search string can be a simple search or a regular expression (be sure to check the 'Regular Expression' checkbox). To create a binary search using special characters, click the [image] button to the right of this field. If you create a Binary search, the string, "Binary mode -->>", is displayed in the search string field. When you are done with this field, the Replace string and the Case Sensitive, Regular Expression and Match Whole Word settings, click "Apply" to save the information to your script.

Note that in the current example, the highlighted line Search/Replace list makes use of Regular Expression search using the * operator.


Script SR List (P)

Search/Replace List: The search/replace items currently in the script are listed in the lower section of the dialog. The checkboxes - [image] and [image] - determine whether that s/r string pair will be used. The default is that all s/r pairs are used. To disable an item, click on the box and uncheck it. To edit a specific s/r pair, highlight it in this list. The Search String and Replace String for the line will then be exposed and you can then modify or delete it as you wish. In the example here, a binary operation is reflected by the phrase "Binary Mode ->>" for the second search string and the third s/r pair will not be used because of the open check ( [image]).


Script Whole Word (P)

Match Whole Word: Check this field if you want to look for the exact word or phrase specified (enclosed by whitespace). For example, if this option is on and you look for "Window", the program will find it in the phrase "...use the Window menu..." but not in the phrase "...Windows 95...". If this option is not checked, both occurrences will be found. To save the information for the current line, click the "Apply" Button. Note that in the example here, Match Whole Word is not available because the Regular Expression field is checked.


Drop Down List

Drop Down Lists: Search and Replace saves your last few choices in the respective input areas to the left of the selection lists. Click here to activate the lists. The number of items saved is configured in General Options .


Edit Menu Jump (P)

Edit Menu: See Edit Menu for more information.


Favorites Menu (P)

Favorites Menu: See Favorites Menu for more information.


Flags Menu Jump (P)

Flags Menu: See Flags Menu for more information.


Help Menu (P)

Help Menu: The Help Menu functions includes choices to activate Search & Replace help, check for updates, and display the program About box.


File Mask (P)

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 is 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 ( [image]). See File Masks for more information.

In the example here, the mask *.htm* will include all files that have a filename suffix ("filetype") involving .htm. For example, this mask would find the files file.htm, home.html, test.html, or weirdnamedfile.htmltxt.

Notes:

  • You can also drag n drop a file 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.


Options Button

Options button: Click this to display the Options Dialog.


Path Field

Path: Enter the path where files to search reside. You may type it by hand, navigate to it by using the Browse button ( [image]), or select a previously used path from the combo list ( [image]).

Notes:

  • 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).

  • Filters and Complex File Mask expressions to further specify which files in the path will be processed.

  • 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

Path Browse Button: Click this to navigate to the desired path via the Path Browser .


Explore From Here (P)

Explore From Here: Select this to launch Windows Explorer on the folder containing the highlighted file.


File Operations (P)

File Operations: Activates the File Operations dialog on the highlighted files.


View Search Results as HTML (P)

View Search Results as HTML: Send the Search Results to an automatically generated HTML file and launch your default web browser.


Print Search Results (P)

Print Search Results: Print the Search Results.


Save Search Results (P)

Save Search Results: Select this to launch save the current Search Results to a text file of your choice.


Touch Selected Files (P)

Touch Selected Files: Click this to Touch the files currently highlighted (if any) in the Search Results list. This is inactive if no files are highlighted. If you wish to Touch all found by your file mask(s), path, & filter options settings, use Touch from the Actions Menu or the Touch toolbar button.


Associated Viewer

Open with Associated Viewer: This right click menu item opens the current file using the associated viewer (program). If there is no file association established on your computer for the highlighted file, the default viewer, configurable in General Options , is used (default is NOTEPAD.EXE). The file to open is determined by the focus in the Search Results list, which is marked by a thin rectangle or a highlight. Open with Associated Viewer is not available if the Search Results is empty.

In the current example, "Open with Associated Viewer" would launch the web browser associated with .htm files.

Note: If the file is in a ZIP file, it is extracted to a subdirectory specified in Search Options . If you edit a file in a ZIP, you must use your ZIP utility to update the ZIP as Search and Replace does not update changes to ZIP files. If you need a ZIP utility, check out our own Directory Toolkit for Windows95/NT.


Copy Results to Clipboard (P)

Copy to Search Results to Clipboard: Selecting this from the right click menu is the same as pressing CTRL-C anywhere in the Search Results list. The contents of the list are copied as text into the clipboard.


Default Viewer

Open with Default Viewer: This right click menu item will launch the Search & Replace default viewer (configurable in General Options ). NOTEPAD.EXE is used if no default viewer has been defined. The file to open is determined by the focus in the Search Results list, which is marked by a thin rectangle or a highlight. Open with Default Viewer is not available if the Search Results is empty. Also see External Editors for more information.

Note: If the file is in a ZIP file, it is extracted to a subdirectory of the path specified in Search Options . If you edit a file in a ZIP, you must use your ZIP utility to update the ZIP as Search and Replace does not update changes to ZIP files. If you need a ZIP utility, check out our own Directory Toolkit for Windows95/NT.


Right Click Menu

Right Click View Context Menu: To display this menu, right click on a file or search results line. Left click if your mouse is set up for left-handed. The View Context menu allows you several choices for viewing the results. The items are the same as those in the upper portion of the Search and Replace View Menu.


Open With

Open with...: Opens the current file using a viewer of your choice. A Select Viewer dialog will allow you to select the viewer to use. This is not available if the Search Results list is empty or if the focus is on a filename line.


View Context (P)

View Context: Activates the internal context viewer. The highlighted file will be opened at the point of the found search string and the string will be highlighted. The highlight color, number of lines displayed in the context viewer, and viewer font are configurable in General Options . If the Search Results list contains nothing or if you have the focus on a filename line, View Context is not available.

In example screen here, the file D:\EXAMPLE\Search(grep) and Replace for.htm would be displayed in the context viewer at line 22.

Note: The context viewer displays text only. However, the 32 bit version of Search and Replace will automatically detect binary files and launch our freeware companion utility, HexView, which can display and print any file as a hex dump. HexView can be downloaded from our web site at http://www.funduc.com.

Note: If the file is in a ZIP file, it is extracted to a subdirectory of the path specified in Search Options . If you edit it, you must use your ZIP utility to update the ZIP since ZIP files are NOT automatically updated.


Regular Expression Field

Regular Expression: Select this to use a Regular Expression. Case sensitive and binary mode may be used in conjunction with this type of search. When regular expression is enabled, the Match Whole Word function is not available. If this button is dim, make sure Ignore Whitespace &/or HTML mode are turned off. Regular Expression mode is not available when either of those are enabled.


Replace String

Replace String: Enter replacement string in this field or select a previous string from the combo list ( [image]). The string 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 [image] button to the right of this field. If you create a Binary replacement, the string, "Binary mode -->>", is displayed in the replace string area.

It is also OK to have a replacement string present during search-only operations. For example, the screen modeled here has a replace string "<body bgcolor="#FFFFFFF" entered even though the screen shot was generated from a search-only operation.

Notes:

  • Please See Word Documents Notes for important information on search & replaces in non-text files such as Word documents, Word Perfect documents, spreadsheets, etc.

  • 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.

  • Replaces are not preformed on files in ZIPs. Manually extract files if you want to make replaces on them.


Search Results List (P)

Search Results List: Your search results are displayed here. The information that is output to the Results list is configurable in Options-Output , e.g., filenames, number of hits, hit lines, etc. The sort order of the files can be adjusted in Options-Search. The display colors are configurable in Options-General . If you are having trouble seeing the results, try changing the colors. You can also enable/disable the tree-style list in Options-General.

In the model screen here, the right click menu available in the results list was captured for purposes of an example (lower right corner). Normally, this is not displayed until you right click on a file or search results line.

See Binary Search Results for a sample dialog if your files are binary.

The search hit tree can be expanded/collapsed by clicking on the [image] / [image] icons or Keyboard Shortcuts.F4/F5 move between files.

To activate the View Context dialog, select either View Context from the right click menu or double click on a line where the search string is displayed. The Enter key also activates the context viewer (Win95/NT version only). If you double click (or press Enter) on the highlighted line in the current example (Line 22 - …), the view context dialog would be displayed with the search string highlighted.

To "Shell to" (launch) the executable associated with a file (in File Manager), double click on a filename line. In the example screen, to activate the web browser associated with .htm files, double click on the line immediately above the highlighted line, e.g., the line that says, "Processing file: D:\EXAMPLE\Search(grep) and Replace for.htm".

The Ctrl+C key will copy the entire contents of Search Results list box to the Windows Clipboard.


Ignore Whitespace Field

Ignore Whitespace: When checked, Ignore Whitespace allows Search and Replace to ignore extra spaces and \r (CR), \n (LF), \t (Tab) characters between whole words. This allows you to easily find, for example, the string "IMG SRC=" even if "IMG" and "SRC=" are on adjacent lines &/or separated by more than one space. Your search string must have one or more of the whitespace characters in the position where the whitespace exists in your file(s) for Ignore Whitespace to work. Note that if you do a replace with Ignore Whitespace on, the intervening extra spaces, & \r \n \t characters are not replaced. Therefore, to maintain these during a replace, use a Regular Expression search/replace. When Regular Expressions is turned on, Ignore Whitespace is not available.


Search ZIPs Field

Search ZIP Files: Select this to search files inside ZIP files that exist in the specified path. When enabled, any PKZIP-compatible ZIP files present in the search path(s) will be examined and any files matching the file masks and filter options specified will be temporarily extracted to the extract path specified under Search Options and searched. This option may slow your searches, so you should turn it off if you do not need it. Note that it is not necessary to specify to *.zip on the file mask field to search ZIP files - simply Select this box. Any file masks specified will be applied to files found inside of ZIP files. Note: Replacements are not made on files in ZIPs.


Collapse-Expand Results

Collapse-Expand Results: Click on the [image] or [image] icons to expand/collapse the search results within file(s). The 'Collapse result branches' setting in Options-General is used to control the default setting in the Search Results list.


Script Button

Script button: Click this to activate the Script Editor .

Note: To write all of the current program settings, including options, to a script file, hold CTRL and click on the script button. This will write a file named "Srdump.srs" in the same path as sr32.exe. You can then edit / rename / use this file as necessary.


Search String

Search String: Enter the string to search for in this field or select a previous string from the combo list ( [image]). The search string can be a simple search or a regular expression. For a binary search using special characters, click the [image] button to the right of this field. If you create a Binary search, the string, "Binary mode -->>", is displayed. If you do not enter a Search String, the file mask, path, and filter settings are used to execute a File Find.

In the screen modeled here, we searched for the string "<body bgcolor="#FFFFFF"" across files of the filetypes *.htm and *.html (the file mask), in the path d:\example.

Note: 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.


Search Button

Search button: Click this to start a search. You can also initiate a search by pressing Enter when the focus is in the Search Results list or the Search String, Replace String, Path, & Mask fields.


Search & Replace Button

Search and Replace button: Click this to begin a search & replace operation. Depending on your settings in Replace Options , you will be prompted before confirmations. We recommend that if you use this feature you also enter a backup path in the Replace Options .


Search Subdirectories Field

Search Subdirectories: Select this to search all subdirectories under the path you defined in the Path field. Note that if you are using a script and have options specified in your script, the Options section of the Advanced Tab in the script editor must be used to control subdirectory searching. The number of levels the program descends can also be controlled if you want.


Touch Button

Touch: Click this to Touch all files found by your file mask(s), path, and filter options settings. You will be prompted for a date, time, and file attributes to use for all the files described by your settings. If you want to touch specific files, perform a search, highlight one or more files in the Search Results list, and use 'Touch Selected Files' on the context menu.


View Menu Jump (P)

View Menu: See View Menu for more information.


Match Whole Word Field

Match Whole Word: Select this to search for the exact word or phrase specified, meaning, it is enclosed by whitespace. For example, if this option is on and you look for "Window", the program will find it in the phrase "...use the Window menu..." but not in the phrase "...Windows 95...". If this option is not checked, both occurrences will be found.


View Context Button

View Context: Click this to launch the Context Viewer.


printf Flag Field

Number Format: Flag Field

Samples (Flag term is in red): %1<%+12.3f(E1-10)>

%1<%+012.3f(E1-10)>

The first optional field of the format specification is flags. A flag directive is a character that justifies output and prints signs, blanks, decimal points, and octal and hexadecimal prefixes. More than one flag directive may appear in a format specification.

Flag | Meaning | Default
+ | Prefix the output value with a sign (+ or –) if the output value is of a signed type. | Sign appears only for negative signed values (–).
0 | If width is prefixed with 0, zeros are added until the minimum width is reached. If 0 and – appear, the 0 is ignored. If 0 is specified with an integer format (i, u, x, X, o, d) the 0 is ignored. | No padding
blank (' ') | Prefix the output value with a blank if the output value is signed and positive; the blank is ignored if both the blank and + flags appear. | No blank
# | When used with the o, x, or X format, the # flag prefixes any nonzero output value with 0, 0x, or 0X, respectively. | No blank
 | When used with the e, E, or f format, the # flag forces the output value to contain a decimal point in all cases. | Decimal point appears only if digits follow it.
 | When used with the g or G format, the # flag forces the output value to contain a decimal point in all cases and prevents the truncation of trailing zeros. Ignored when used with c, d, i, u, or s. | Decimal point appears only if digits follow it. Trailing zeros are truncated.


printf Flag Field (P)

Flag Field:

Samples (Flag term is in red): %1<%+12.3f(E1-10)>

%1<%+012.3f(E1-10)>

The flag field is a character that controls justification and output of signs, blanks, decimal points, and octal and hexadecimal prefixes. More than one flag character is allowed.

+, 0 and <space> are the most common choices.

- is not supported by Search and Replace.

Examples:

%1<% 12.3f(E1-10)> - Subtract 10 from the number found by the first search term, output as 12 wide, space padded, 3 places after decimal.

%1<%+06.2f(E1-10)> - Subtract 10, put + in front of positive numbers or - for negative, output at least 6 wide, pad with 0's.

See Number Format: Flag for more information.


printf Math Operations

Math Operations

Sample (Math term is in red): %1<% 12.3f(E1-10)>

To perform a math operation on the found string, specify the format you want and then surround the math syntax inside ( ). Put this just before the closing > character for that component of the replace term.

Use E1, E2, E3, ... etc to reference the Search and Replace %n operator to use. For example, if %1 is the found string you want to do a math operation on, use E1. If %3 is the found string of interest, use E3.

It is up to you to make sure the two correspond! The program currently does not check for mismatches. You could do something like %1<%d(E4/2)>, which references %1 for the number formatting but then divides %4 by 2. Obviously this would be silly.


printf Math Operations (P)

Math Operations:

Sample (Math term is in red): %1<% 12.3f(E1-10)>

To perform a math operation on the found string, specify the format you want and then surround the math syntax inside ( ). Put this just before the closing > character for that component of the replace term.

Use E1, E2, E3, ..., etc to reference the Search and Replace %n operator to use. For example, if %1 is the found string you want to do a math operation on, use E1. If %3 is the found string of interest, use E3.

It is up to you to make sure the two correspond! The program currently does not check for mismatches. You could do something like %1<%d(E4/2)>, which references %1 for the number formatting but then divides %4 by 2. Obviously this would be silly.


printf Precision Field

Number Format: Precision Field

Sample (Precision is in red): %1<% 12.3f(E1-10)>

The third optional field of the format specification is precision. It specifies a nonnegative decimal integer, always preceded by a period (.), which specifies the number of characters to be printed, the number of decimal places, or the number of significant digits (see second table below). Unlike the width specification, precision can cause either truncation of the output value or rounding of a floating-point value. If precision is specified as 0 and the value to be converted is 0, the result is no characters output, as shown below:

printf( "%.0d", 0 ); /* No characters output */

If the precision specification is an asterisk (*), an int argument from the argument list supplies the value. The precision argument must precede the value being formatted in the argument list.

The type field determines the interpretation of precision and the default when precision is omitted, as shown in the following table.

Type Field | Meaning | Default
c, C | The precision has no effect. | Character is printed.
d, i, u, o, x, X | The precision specifies the minimum number of digits to be printed. If the number of digits in the argument is less than precision, the output value is padded on the left with zeros. The value is not truncated when the number of digits exceeds precision. | Default precision is 1.
e, E | The precision specifies the number of digits to be printed after the decimal point. The last printed digit is rounded. | Default precision is 6; if precision is 0 or the period (.) appears without a number following it, no decimal point is printed.
f | The precision value specifies the number of digits after the decimal point. If a decimal point appears, at least one digit appears before it. The value is rounded to the appropriate number of digits. | Default precision is 6; if precision is 0, or if the period (.) appears without a number following it, no decimal point is printed.
g, G | The precision specifies the maximum number of significant digits printed. | Six significant digits are printed, with any trailing zeros truncated.
s, S | The precision specifies the maximum number of characters to be printed. Characters in excess of precision are not printed. | Characters are printed until a null character is encountered.

If the argument corresponding to a floating-point specifier is infinite, indefinite, or NAN, printf gives the following output.

Value | Output
+ infinity | 1.#INFrandom-digits
– infinity–1. | #INFrandom-digits
Indefinite (same as quiet NaN) | digit.#INDrandom-digits
NAN | digit.#NANrandom-digits


printf Precision Field (P)

Precision Field:

Sample (Precision is in red): %1<% 12.3f(E1-10)>

Precision is the third optional field. Precision is always preceded by a . character. Precision determines the number of decimal places to be output. If the value you specify is less than the number of places returned by the program, the result is rounded. .0 is permitted.

See Precison Field for information about the default digits returned for the different type specifications. Most commonly, d has default of 1 digit and f has a default of 6.


printf Size Field

Number Format: Size Field

Sample (Size is in red): %1<%6.3lf(E1-10)>

Search and Replace has some support for the printf-type size prefix field, an optional prefix to type that determines the "size" of the argument. In most cases you can omit a size character. l is the most common use.

To specify | Use prefix | With type specifier
long integer | l | d, i, o, x, or X
long unsigned integer | l | u
short integer | h | d, i, o, x, or X
short unsigned integer | h | u
__int64 | I64 | d, i, o, u, x, or X
Single-byte character | h | c or C
Single-byte character | h | c or C
Wide character | l | c or C
Wide character | l | c or C
Single-byte – character string | h | s or S
Single-byte – character string | h | s or S
Wide-character string | l | s or S
Wide-character string | l | s or S

Thus to print single-byte or wide-characters with printf functions and wprintf functions, use format specifiers as follows.

To print character as | Use function | With format specifier
single byte | printf | c, hc, or hC
single byte | wprintf | C, hc, or hC
wide | wprintf | c, lc, or lC
wide | printf | C, lc, or lC


printf Size Field (P)

Size Field:

Sample (Size is in red): %1<%6.3lf(E1-10)>

Search and Replace has some support for the printf-type size prefix field, an optional prefix to type that determines the "size" of the argument (long or short, single-byte character or wide character). In most cases you can omit a size character. l is the most common use.

See Size Field for more information.


printf SR n term (P)

%n term:

Sample (%n term is in red): %1<%+12.3f(E1-10)>

%n is one of the standard Search and Replace Regular Expression replacement terms - %1, %2, %3, and so on. This must be present and must be immediately before the first opening < character. When this is so the formatting specifications you supply will be applied to that %n term. See %n terms for more information.

Examples:

%1<%06ld>: Take the %1 material and output as an integer number, 6 places wide, 0 padded to the left.

%9<%06ld>: Same thing but to the %9 material.

You can have multiple terms in the overall replacement string. For example, this is OK:

S:+[0-9.\-\+]+[ \t]+[0-9.\-\+] ?? ??? +[0-9.\-\+]

R:%1<%06ld> and %3<%06ld> and %9<%06ld>


printf Type Field

Number Format: Type Field

Samples (Type is in red): %1<%6.3f(E1-10)>

%1<%d(E1-10)>

Type is the only required field. This must appear last ; after all the other optional formatting fields. The type character determines whether the associated argument is interpreted as a character, string, or number. Not all types are supported by Search and Replace.

Character | Output format
c or C | Outputs the ASCII character corresponding to the number found by the search term.
d | Signed decimal integer.
i | Signed decimal integer.
o | Unsigned octal integer.
u | Unsigned decimal integer.
x | Unsigned hexadecimal integer, using "abcdef."
X | Unsigned hexadecimal integer, using "ABCDEF."
e | Signed Exponent format, such as 3.2e+002.
E | As above but uses a capital E in front of the exponent section, e.g., 0.2E+015.
f | Signed "floating point" number such as 32.00000 or -8.000000. If precision is not specified, 6 decimal places are output. You should always use f if your search returns decimal number strings. Also, f must be used when your search returns number strings over 10 numbers in length.
g | Signed value printed in f or e format, whichever is more compact for the result and precision. The e format is used when the exponent of the value is less than –4 or >= to the precision argument. Trailing zeros are truncated. The decimal point appears only if one or more digits follow it.
G | As above but uses capital E if an exponent is output.
p | Prints the address of the argument in hexadecimal digits.


printf Type Field (P)

Type Field:

Samples (Type is in red): %1<%6.3f(E1-10)>

%1<%d(E1-10)>

Type is the only required field. This must appear last ; after all the other optional formatting fields. The type character determines whether the associated argument is interpreted as a character, string, or number. For those familiar with printf / wprintf, not all types are supported by Search and Replace.

See Type Field for more information and choices.

The most common choices are:

Character | Effect
d | Signed decimal integer.
i | Signed decimal integer.
f | Signed "floating point" number such as 32.00000 or -8.000000. If precision is not specified, 6 decimal places are output. You should always use f if your search returns decimal number strings. Also, f must be used when your search returns number strings over 10 numbers in length.
c or C | Outputs the ASCII character corresponding to the number found by the search term.


printf Width Field

Number Format: Width Field

Samples (Width is in red): %1<%12.3f(E1-10)>

%1<%0.3f(E1-10)>

The second optional field of the format specification is the width specification. The width argument is a nonnegative decimal integer controlling the minimum number of characters printed. If the number of characters in the output value is less than the specified width, blanks are added to the left or the right of the values — depending on whether the – flag (for left alignment) is specified — until the minimum width is reached. If width is prefixed with 0, zeros are added until the minimum width is reached (not useful for left-aligned numbers).The width specification never causes a value to be truncated. If the number of characters in the output value is greater than the specified width, or if width is not given, all characters of the value are printed (subject to the precision specification).

If the width specification is an asterisk (*), an int argument from the argument list supplies the value. The width argument must precede the value being formatted in the argument list. A nonexistent or small field width does not cause the truncation of a field; if the result of a conversion is wider than the field width, the field expands to contain the conversion result.


printf Width Field (P)

Width Field:

Samples (Width is in red): %1<%12.3f(E1-10)>

%1<%0.3f(E1-10)>

Width is the second optional field. This is a positive integer that determines the minimum number of characters to be output. If the number returned by the program is longer than the value you specify, then the entire results is returned. If then number is smaller than the width value, then the output is automatically space padded or padded with the character you specify. If you don't want any padding you can use 0.

The type specified also relates to the minimum width. For example, floating point numbers default to 6 places after the decimal. The precision spec is used to refine the number of decimal places to output.

See Width Field for more information.


Right Click Context Menu (P)

Right Click Context Menu: The 'right click' Context Menu in the main dialog is activated by highlighting any line in the Search Results List and right clicking with the mouse. Left click if your mouse is set up for left-handed use. Some functions may not be available depending on whether the filename or a replace string is highlighted.

Please see Right Click Context Menu for more information.


About Search and Replace

Search and Replace for Windows

Copyright © 1995-2010 Funduc Software, Inc.
All Rights Reserved
 www.funduc.com www.searchandreplace.com

See Ordering Information for details on how to purchase Search and Replace or write us at support@funduc.com. See License Information for details about licensing. For customer support, write support@funduc.com or visit our web site at www.funduc.com.

Feature Suggestions? Write support@funduc.com.

Also check our web site for product information, trialware & freeware downloads of our other award winning software products.


Binary Mode Add Code Button

Add Code Button: Click here to insert the codes you highlighted in the Binary Codes list into the Search (or Replace) block at the top of the dialog.


Apply Script Button

Apply Script Button: The Apply Script Function allows you to apply a script to the search &/or replace strings in order to transform them into something else in advance of a later operation.


Binary Mode - Add to Bottom of File

Add to Bottom of File: When checked, Search and Replace will insert the string in the Replace field on the main screen to the bottom of each file found. This append operation takes precedence over normal searches and when this field is checked, the Binary Search Block field will notify you accordingly. The Special Search Operation radio button area shown here is not available when editing a binary replacement string.


Binary Mode Cancel Button

Cancel: Abort the operation and return to the main window.


Binary Mode Codes (P)

Binary Mode Codes: This is a complete list of supported codes. Highlight a code you want to use and click on the "Add Code" button to insert it in the Search/Replace block field. The list of 'special character codes' can be seen HERE.


Binary Mode Help Button

Help Button: 'Yep, this activates the online help.


Binary Mode OK Button

OK: Click here when you are finished editing the Search/Replace block field.


Binary Mode Paste Button

Paste Button: Pastes the current content of the clipboard into the Search/Replace Block field.


Binary Mode - Use Search String

Use Search String: When checked, all normal search functions are available. In most cases, this is the setting you will use. The Special Search Operation radio button area shown here is not available when editing a binary replacement string.


Binary Mode Search/Replace Block

Binary Mode Search/Replace Block: Shown here is the dialog for a search field that makes use of a regular expression (*[0-9]) and looks for carriage return\line feed (\r\n). You can type in, paste text from the clipboard, or use the Binary Codes list to add characters to this field. The ctrl key editing shortcuts ^C (copy), ^V (paste), ^X (cut), & ^Z (undo) work here. The Paste Button will also paste in the clipboard contents.


Binary Mode - Add to Top of File

Add to Top of File: When checked, Search and Replace will insert the string in the Replace field on the main screen to the top of each file found. This prepend operation takes precedence over normal searches and when this field is checked, the Binary Search Block field will notify you accordingly. The Special Search Operation radio button area shown here is not available when editing a binary replacement string.


Save Changes (View Context)

Save Changes?

Click the Yes button to save the modifications. Click the No button to abandon the modifications.


Scripts - Expression Evaluator Error

The program has detected a syntax error in your expression in the 'Process file when expression is non-zero' field in the Scripts-Advanced tab. See Expression Evaluator for more information.

In most cases this is caused by problems with the ( ) characters. If you are having trouble dismissing closing the Advanced tab because the error message reappears, make a very simple entry such as
E1

This will surely be OK and permit you to close the dialog so you can return to your work later.


Search and Replace Title

Search and Replace for Windows

Funduc Software Inc.
Copyright © 1995-2010 Funduc Software, Inc
All Rights Reserved
www.searchandreplace.com www.funduc.com
support@searchandreplace.com support@funduc.com

Funduc Software, Inc.
P.O. Box 530904
Livonia, MI 48153-0904
USA

V: 435 921-0900 or 734 462-1552
F: 435 921-0900 or 734 462-1886


Special Characters - Old

Here is the list of Special characters:

Code | Explanation | Code | Explanation
\0x00 | Character 0 | \0x7f | Character 127
\0x01 | Character 1 | \0x80 | Character 128
\0x02 | Character 2 | \0x81 | Character 129
\0x03 | Character 3 | \0x82 | Character 130
\0x04 | Character 4 | \0x83 | Character 131
\0x05 | Character 5 | \0x84 | Character 132
\0x06 | Character 6 | \0x85 | Character 133
\a | ASCII Bell character | \0x86 | Character 134
\b | ASCII Backspace character | \0x87 | Character 135
\t | TAB | \0x88 | Character 136
\n | Line Feed (See Note) | \0x89 | Character 137
\v | Vertical TAB | \0x8a | Character 138
\f | Form Feed | \0x8b | Character 139
\r | Carriage Return (See Note) | \0x8c | Character 140
\0x0e | Character 14 | \0x8d | Character 141
\0x0f | Character 15 | \0x8e | Character 142
\0x10 | Character 16 | \0x8f | Character 143
\0x11 | Character 17 | \0x90 | Character 144
\0x12 | Character 18 | \0x91 | Character 145
\0x13 | Character 19 | \0x92 | Character 146
\0x14 | Character 20 | \0x93 | Character 147
0x\15 | Character 21 | \0x94 | Character 148
0x\16 | Character 22 | \0x95 | Character 149
\0x17 | Character 23 | \0x96 | Character 150
\0x18 | Character 24 | \0x97 | Character 151
\0x19 | Character 25 | \0x98 | Character 152
\0x1a | Character 26 | \0x99 | Character 153
\0x1b | Character 27 (ESC char) | \0x9a | Character 154
\0x1c | Character 28 | \0x9b | Character 155
\0x1d | Character 29 | \0x9c | Character 156
\0x1e | Character 30 | \0x9d | Character 157
\0x1f | Character 31 | \0x9e | Character 158
 | (space) | \0x9f | Character 159
! | ! | \0xa0 | Character 160
\" | " | \0xa1 | Character 161
# | # | \0xa2 | ¢
$ | $ | \0xa3 | £
% | % | \0xa4 | ¤
& | & | \0xa5 | ¥
\' | ' | \0xa6 | ¦
( | ( | \0xa7 | §
) | ) | \0xa8 | ¨
* | * | \0xa9 | ©
+ | + | \0xaa | ª
, | , | \0xab | «
- | - | \0xac | ¬
. | . | \0xad |
/ | / | \0xae | ®
0 | 0 | \0xaf | ¯
1 | 1 | \0xb0 | °
2 | 2 | \0xb1 | ±
3 | 3 | \0xb2 | ²
4 | 4 | \0xb3 | ³
5 | 5 | \0xb4 | ´
6 | 6 | \0xb5 | µ
7 | 7 | \0xb6 | ¶
8 | 8 | \0xb7 | ·
9 | 9 | \0xb8 | ¸
: | : | \0xb9 | ¹
; | ; | \0xba | º
< | < | \0xbb | »
= | = | \0xbc | ¼
> | > | \0xbd | ½
\? | ? | \0xbe | ¾
@ | @ | \0xbf | ¿
A | A | À | À
B | B | Á | Á
C | C | Â | Â
D | D | Ã | Ã
E | E | Ä | Ä
F | F | Å | Å
G | G | Æ | Æ
H | H | Ç | Ç
I | I | È | È
J | J | É | É
K | K | Ê | Ê
L | L | Ë | Ë
M | M | Ì | Ì
N | N | Í | Í
O | O | Î | Î
P | P | Ï | Ï
Q | Q | Ð | Ð
R | R | Ñ | Ñ
S | S | Ò | Ò
T | T | Ó | Ó
U | U | Ô | Ô
V | V | Õ | Õ
W | W | Ö | Ö
X | X | \xd7 | Character 215
Y | Y | Ø | Ø
Z | Z | Ù | Ù
[ | [ | Ú | Ú
\\ | \ | Û | Û
] | ] | Ü | Ü
^ | ^ | Ý | Ý
_ | _ | Þ | Þ
` | ` | ß | ß
a | a | à | à
b | b | á | á
c | c | â | â
d | d | ã | ã
e | e | ä | ä
f | f | å | å
g | g | æ | æ
h | h | ç | ç
I | I | è | è
j | j | é | é
k | k | ê | ê
l | l | ë | ë
m | m | ì | ì
n | n | í | í
o | o | î | î
p | p | ï | ï
q | q | ð | ð
r | r | ñ | ñ
s | s | ò | ò
t | t | ó | ó
u | u | ô | ô
v | v | õ | õ
w | w | ö | ö
x | x | 0xf7 | Character 247
y | y | ø | ø
z | z | ù | ù
{ | { | ú | ú
| | | | û | û
} | } | ü | ü
~ | ~ | ý | ý
 |  | þ | þ
 |  | ÿ | ÿ


Add

Add Click here to move the highlighted button(s) or separator in the list of Available Buttons to the Toolbar Buttons list. You can then use the Move Up / Move Down buttons to change the placement of the button in the Toolbar Buttons list.


Available Buttons

Available Buttons A list of available buttons is presented here. Except for separators, which may be used multiple times, if a button is already in use it will not be listed. To use a button or add a separator, highlight it and click on the Add button in the center of the dialog.


Close

Close Accept the toolbar button arrangement as defined in the dialog and close the dialog. If you want to cancel your current changes, click on Reset and then click on Close.


Help

Help Activates program help.


Move Down

Move Down Moves highlighted button or separator down by one.


Move Up

Move Up Moves highlighted button or separator up by one.


Remove

Remove Click here to remove the highlighted button(s) or separator in the list of Toolbar Buttons list. They will be placed in the list of Available Buttons.


Reset

Reset Dismisses changes made during the session to the previous saved arrangement.


Current Toolbar Buttons

Current Toolbar Buttons A list of buttons and separators currently in use is presented here. To remove a button or separator, highlight it and click on the Remove button in the center of the dialog.


Add to File Time

Add to File Time: This function adds (or subtracts) the specified number of seconds to the current time stamp for the file(s). To subtract seconds, enter a negative value. For example, to roll back the current time stamp by one hour, enter a value of 3600. The file date will also be adjusted +/- if your "Add to File Time" value causes the new file time cross midnight. If "Also Set Creation Date" &/or "Also Set Access Date" are checked, these values will also be adjusted.


File Attributes

File Attributes: Mark some or all of the fields. The checkboxes have three choices - marked, unmarked, and a dim mark. The dim-check choice is used if you want to leave the attribute setting for that field unchanged. For example, in the example here, the Read Only field is a dim mark. This means that files already having a Read Only attribute setting will remain so. Conversely, those not already set as Read Only will not be set to Read Only. The solid mark in the Archive field means that all files will be set to Archive. The unmarked settings for Hidden & System means that Hidden &/or System attributes, if present for any files, would be removed.


Touch Cancel Button

Cancel Button: No files will be touched.


Date Field

Date Field: Enter the date to be used. The date format follows the regional settings for your computer so make your entry in the form as it appears in the field. 00 or 2000 may be used for the year 2000 and above.


Touch Help Button

Help Button: 'Bet you know what this does...


Touch OK Button

OK Button: The dates and times &/or attributes will be set for all the files described by the file mask, path, and filter criteria.


Set Access Date

Also Set Access Date: Mark this field to also change the Last Access date. This field is dim and not available in the Win3x version.


Set Date/Time and Attributes

Set Date/Time and Attributes: Mark this field if you want to change both the time/date stamp and the file attributes. This field is mutually exclusive with the "Set Files' Date/Time Only" and the "Set Files' Attributes Only" fields.


Set Files' Attributes Only

Set Files' Attributes Only: Mark this field if you only want to change the attributes for the files. This field is mutually exclusive with the "Set Files' Date/Time Only" and the "Set Date/Time and Attributes" fields.


Set Creation Date

Also Set Creation Date: Mark this field to also change the Creation date. This field is dim and not available in the Win3x version.


Set Files' Date/Time Only

Set Files' Date/Time Only: Mark this field if you only want to change the time & date stamp for the files. This field is mutually exclusive with the "Set Files' Attributes Only" and the "Set Date/Time and Attributes" fields.


Time Fields

Time Fields: Enter the time to be used using a format that corresponds to the Regional Settings for your computer. Regional Settings are established in Windows Control Panel.


Touch Update Button

Update Button: The date and time fields will be refreshed using the current date and time according to the PC's clock.


Update Check

Updates - Check for Updates

To check for available updates for the program, activate the Help Menu and select 'Check for updates'. If an update is available the program offers to launch your mail client and send a message to updates@funduc.com. After we receive your mail we will provide update instructions. Please adjust your mail filters to permit messages from updates@funduc.com. Thanks.

Note: An internet connection is required for 'Check for Updates' to function.


View Context Cancel Button

Cancel Button The changes will not be made.


View Context Help Button

Help Button Activates the program help.


View Context Next Hit Button

Next Hit Button Jump to the next hit (if any). CTRL+PgDn does the same thing.


View Context Page Down Button

Page Down Button Jump the entire display down by one screen.


View Context Page Up Button

Page Up Button Jump the entire display up by one screen.


View Context Previous Hit Button

Previous Hit Button Jump to the previous hit (if any). CTRL+PgUp does the same thing.


View Context Search Results Area

Hit Context The context surrounding each search hit is displayed here. The color of search hits, number of lines displayed, and display font is configurable under General Options. You may edit this text and make use of the shortcut keys below (registered version only). Changes made to results in ZIP files are not automatically updated so you must update the zip manually. To jump to the next or previous search hit, press ^PgDn / ^ PgUp or the use the icons at the upper right of the dialog. To scroll the screen down or up, press the PgDn / PgUp keys or use the buttons at the bottom of the dialog.

Windows Shortcuts
Copy | Ctrl+C
Paste | Ctrl+V
Cut | Ctrl+X
Undo | Ctrl+Z


View Context Save Button

Save Button The changes will be made (registered version only). Changes made to results in ZIP files are not automatically updated so you must update the zip manually. If you need a ZIP utility, take a look at our own Directory Toolkit.