I am evaluating if the below need will be possible by Informatica developer Data processor transformation and parser. Could you please check and help? Please see the input and expected output below.
Need: Convert multiple versions of Pipe delimited text file into a single version.
File Version 1:
File Version 2:
Output File (keep both records in version 1):
The new fields and corresponding data could go to a separate output file.
Here are the planned steps for the script.
1. Identify the first field in header till the first delimiter and store in a variable.
2. Compare if the variable has the value "Name". To make this possible, can constants be defined in the Parser?
If value matches the constant, Move the marker to next line (first data record) and read the content till the first delimiter.
If not, move the marker to next line (first data record) and read till first delimiter and store the length/offset. Can the length/offset be stored using the parser, to be checked back later in the parser?
3. Can the marker be moved back to the first line and read the header till next delimiter? Then repeat the step 2 for the next header column to be moved to output. While reading the data record, use the stored offset as beginning point and read till next delimiter.