Follow the steps below to search files in a File Set for a pattern and replace it with other characters:
From within the Project Designer page, expand the File System folder in the Component Library, and then drag the Search and Replace task to the Project Outline.
On the Basic tab of the Search and Replace task, specify values for the following attributes:
Output Directory
Specify the directory location on the local file system where the modified files should be written.
Search For
The string (pattern) to search for within the input file(s). All values will be searched for as their string literals. Regular expressions are not allowed. The backslash character '\' is an escape character that can be used to search for special characters. Below is a list of escape sequences that are permitted.
\n - New line.
\r - Carriage return.
\t - Tab.
\\ - Represents a single \.
\xFF - A hex value. Replace FF with a valid 2-byte hex value.
\u0000 - A Unicode value. Replace 0000 with a valid Unicode value.
Replace With
The replacement string to be written in place of the
Search For
match. In order to simply delete the
Search For
characters, use the ${system.emptyString} variable as the Replace With value. Escape sequences are permitted. For a list of valid escape sequences please refer to the list above under the
Search For
attribute.
Max Number of Replacements
attribute on the Advanced tab controls how many times the value will be replaced.
Click the
Add
button and choose Add a File Set.
On the File Set element, specify the following attributes:
Base Directory
Specify the starting directory for this File Set. If no filters are defined, all files in this directory will be included.
Click the
Save
button when finished. When the project executes, all the files in the C:\EmployeeData folder will be searched for tab ('\t') string and replaced with a unit separator string ('\x1f').