Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. XMap
  7. Libraries
  8. Schema Object
  9. Command Line Interface
  10. Scripts
  11. Parsers
  12. Script Ports
  13. Document Processors
  14. Formats
  15. Data Holders
  16. Anchors
  17. Transformers
  18. Actions
  19. Serializers
  20. Mappers
  21. Locators, Keys, and Indexing
  22. Streamers
  23. Validators, Notifications, and Failure Handling
  24. Validation Rules
  25. Custom Script Components

Data Transformation User Guide

Data Transformation User Guide

Example of AdditionalInputPort

Example of AdditionalInputPort

Suppose you have two text files:
  • IdsAndSalaries.txt
    is a table of employee IDs and salaries.
  • IdsAndNames.txt
    is a table of employee IDs and names.
You want to parse these files jointly, generating an XML output file containing the employee names and salaries. You can configure the transformation in the following way:
  • The main Parser, called
    EmployeeParser
    , processes
    IdsAndSalaries.txt
    .
  • The main Parser activates a secondary Parser, called
    IdsToNamesParser
    , which processes
    IdsAndNames.txt
    and stores the result in an XML table.
  • The main Parser uses a
    LookupTransformer
    to convert the IDs to names. The lookup table is the output of the secondary Parser.
The following figure shows an example of a Script with a secondary Parser that references an
AdditionalInputPort
to retrieve the
IdsAndNames.txt
file:
Global level EmployeeParser = Parser >> Level 1 example_source = LocalFile >> Level 2 file_name = IdsAndSalaries.txt Level 1 format = CustomFormat() Level 1 contains line Level 1 RunParser >> Level 2 selected input_source_as_text Level 2 next_Parser = IdsToNamesParser Level 2 input_source = $IdsToNames Level 1 RepeatingGroup() Level 1 ... Global level IdsToNames = Variable() Global level IdsToNamesPort = AdditionalInputPort >> Level 1 data_holder = $IdsToNames Level 1 input_encoding = ... Level 1 example_source = LocalFile >> Level 2 file_name = IdsToNames.txt Global level IdsToNamesParser = Parser >> Level 1 example_source = InputPort Level 2 Port = IdsToNamesPort Level 1 format = CustomFormat() Level 1 contains line Level 1 RepeatingGroup()