Table of Contents

Search

  1. Preface
  2. Introduction
  3. Dashboard
  4. Resources
  5. Workflows
  6. Task Reference
  7. Services Overview
  8. Users
  9. Logs and Reports
  10. Encryption
  11. System
  12. Appendix
  13. Glossary Terms

Example 2: Search and Replace Multiple Files

Example 2: Search and Replace Multiple Files

Follow the steps below to search files in a File Set for a pattern and replace it with other characters:
  1. 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.
  2. 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.
  3. Click the
    Add
    button and choose Add a File Set.
  4. 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.
  5. 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').

0 COMMENTS

We’d like to hear from you!