Special Processing: Search and Replace a String

 

You can swap out a piece of text within a single file or set of files with this special process. Simply choose the file(s) to process, what text string to search for and what to replace with.

image\ebx_-1259183312.gif

In order to specify multiple files to be searched, place the folder name in the Input File location, followed by a wildcard and the file type. For example, C:\IN\*.TXT will cause every txt file within the C:\IN\ folder to be searched for the specified string. If a single file is to be searched, simply specify the individual file name, e.g., C:\TestFolder\OneFile.doc.

Replacements may be made to the input file or placed in another file. If the replacement(s) are to be made in the input file, simply use the same file name in path in both the Input File and Target File locations. Otherwise a different output filename may be specified and another file, implementing the replacement(s), will be created. Note that if the specified output file already exists it will be replaced.

 

Special Control Characters

Below the search and replacement text boxes are ASCII char specification list boxes. You can use ASCII characters to indicate symbols and control characters that otherwise can't be shown in your search and/or replacement strings. For example, if you want to search for a string that includes a return ("enter"), you would select the ASCII character [10]LF from the ASCII char list box. It will display in your string as ©10©. To create a replacement string that reads '1. First item.' where the 1. is followed by a tab, select [9]TAB to place ©9© into your string. The entire replacement string will appear as '1.©9©First item.'

Note: Although you will search for an "enter" with the ASCII linefeed character only ([10]LF), if you want to place an "enter" into the replacement string you must combine the two ASCII characters [13]CR and [10]LF. For example, if you wanted to add returns after each word in the search string 'this is a string', your replacement string would look like 'this ©13© ©10©is ©13© ©10©a ©13© ©10©string' where the ASCII characters have been selected from the ASCII char list box.

Another useful ASCII character is [32]SPACE.

 

More:

Quick Start - Special Processing on Files

Special Processing: Removing Empty Lines

Special Processing: Appending Files (Concatenation)

Special Processing: Search and Replace a String