How to: |
Syntax:
com.ibi.preemit.XDCharRepl
Description:
This preemitter replaces paired characters in the input stream. The lengths of the Input field and the Replace With field have to be the same. Use the Replaced paired characters preemitter when the final document has character processing to be done whereby characters and line feeds have to be replaced of if a specific character has to be replaced has to be replaced in the output document.
For example, if a name is misspelled in the output document as rom instead of tom, then the character r could be replaced with t in the document. It is similar to the find and replace in almost all tools.
Parameters:
Parameter | Description |
---|---|
Input | String of individual characters replace. ([char]|\0x[hexpair]|\n|\t)*. For example, it could be (|\0x|\n|\t)* or a single character such as [a...z]. |
Replace with | String of characters to replace input with. Count must match number in input. ([char]|\0x[hexpair]|\n|\t)*. |
CR Replace | Replace carriage return (0x0d) and line feed (0x0a) patterns. |
The Input is r in this example. The Replace With field is t.
The Name and Description pane opens.
The name of the preemitter should be CharRepl.
After the CharRepl Preemitter is added to iWay Service Manager, create an outlet, PreemitterOutlet and add the CharRepl Preemitter to this outlet. Create a file emitter which writes to a flat file a*.txt. Also add the file emitter to this outlet.
Construct the channel PreemitChannel using a file listener case1 as inlet, a simple move route and the outlet created in the previous step.
The Input file is a text document, document2.txt as shown as follows.
<a> <t> <b name="rom"> <c>value of input element<c> </b> <b name="rom2"> <c>value of input element</c> </b> </t> </a>
The output document document2_out.txt would look like the following output.
<?xml version="1.0" encoding="ISO-8859-1" ?> <a> <t> <b name="tom"> <c>value of input element</c> </b> <b name="tom2"> <c>value of input element</c> </b> </t> </a>
iWay Software |