Table of Contents

Search

  1. Preface
  2. Informatica Managed File Transfer Welcome Overview
  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

Search and Replace Task

Search and Replace Task

The Search and Replace task can search one or more files for a string value (pattern) and replace that pattern with characters specified in the
Replace With
attribute.
Field
Definition
Basic Tab
Label
Specify a label for this task.
Input File
Specify the path and file name of a file to scan and modify.
Input Files Variable
Specify the name of a variable of type File List which contains the files to scan and modify. For example, ${variableName}
Output File
Specify the path and file name of the output file where the modified data should be written. This is only applicable when modifying a single file.
Output Directory
Specify the directory location on the local file system where the modified files should be written.
When File Exists
Specify the action to take when the output file already exists. The default action is rename, which will auto-rename the output file leaving the existing file untouched. Default Value: rename
Search For
Specify the search pattern to use to search for and replace characters in the input file(s). All values will be searched for as their string literals. Regular expressions are not allowed. The following escaped characters are permitted \n (new line), \r (carriage return), \t (tab), \x (hex characters), and \u (unicode characters). Also, in order to search for a literal backslash character, the backslash must be escaped such as \\.
Replace With
Specify the replacement string to be written in place of the Search For match. Escaped characters \n, \r, and \t are permitted. In order to simply delete the Search For characters, use the ${system.emptyString} variable as the Replace With value.
Advanced Tab
Case Sensitive Search
Specify whether or not to search the file(s) in case sensitive mode. The default setting is true which improves the search performance, but will not match strings that do not have the same case.
Default Value: true
Encoding
Specify the file encoding. This is required if the files are using a different encoding than the platform's default. For example, UTF-8 or US-ASCII.
Default Value: The platform's default encoding
Max Number of Replacements
Specify the maximum number of replacements to make on each file. Use this attribute to limit the replacements to a certain number of times. Each file will allow this many replacements. The default value is 0 which does not set a limit to the number of replacements
Default Value: 0 - no limit
Output Variables Tab
Output Files Variable
If desired, specify the name of a variable which will contain the modified output files. The variable will be of type File List and may be used in subsequent tasks that accept a File List input variable. The variable will be created if it does not exist.
Processed Files Variable
If desired, specify the name of a variable which will contain the processed input files. The variable will be of type File List and may be used in subsequent tasks that accept a File List input variable. The variable will be created if it does not exist.
Number of Files Processed Variable
If desired, specify the name of a variable which will contain the number of files successfully processed by this task. The variable will be created if it does not exist.
Number of Replacements Variable
If desired, specify the name of a variable which will contain the number of replacements made in all files processed by this task. The variable will be created if it does not exist.
Control Tab
Version
The version of this task.
Log Level
Specify the level of logging to use while executing this task. Valid options are - silent, normal, verbose and debug.
Default Value: Inherited from parent Module
Execute Only If
Specify a condition that must be satisfied before this task can be executed. This task will be skipped if the specified condition is not met.
Disabled
Whether or not this task is disabled.
Default Value: false
On Error Tab
On Error
Specify the action to take when this task errors out. Valid options are - abort, continue, call:[module] and setVariable:[name]=[value]. For call:[module] replace [module] with the name of the module in the project (e.g. call:ErrorModule). For setVariable:[name]=[value] replace [name] with a variable name and [value] with the variable value (e.g. setVariable:error=true).
Default Value: Inherited from parent Module
This task uses the File Set Elements. The field definitions for the File Set Elements can be found on the File Lists and File Sets topic.

0 COMMENTS

We’d like to hear from you!