Overview
Script task to perform find and replace.
Setup
Script to:
- Find specific combination in a Source or ...
- Find specific combination in a Source, replace with another combination and store in a Target.
The Source and Target can be either a file or System.IO.Stream object. When you want to specify special control characters use "\" to escape it. For example carriage return is "\r" and line feed is "\n".
When specified action is "Find", the task provides following parameters:
- Find - combination to match.
- StartIndex - position from where to start the search.
- ResultVariable - package variable where to store found index.
- IsSourceVariable - if true, Source is contained in package variable. Otherwise it is file connection manager (Boolean).
- SourceVariable - source package variable (String). The variable type can be either string (source file path) or Object (Stream).
- Source - source file connection manager (Connection).
When specified action is "FindAndReplace", the task provides following parameters:
- Find - combination to match.
- Replace - combination to use as a replacement for a match.
- IsSourceVariable - if true, Source is contained in package variable. Otherwise it is file connection manager (Boolean).
- SourceVariable - source package variable (String). The variable type can be either string (source file path) or Object (Stream).
- Source - source file connection manager (Connection).
- IsTargetVariable - if true, Target is contained in package variable. Otherwise it is file connection manager (Boolean).
- TargetVariable - target package variable (String). The variable type can be either string (source file path) or Object (Stream).
- Target - target file connection manager (Connection).
Configuration
To use this script, you would need to load it in COZYROC JavaScript Task. You can download the JavaScript file and browse to it via the "Import JavaScript code" button.

Ready to give it a try?
COZYROC SSIS+ Components Suite is free for testing in your development environment.