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. Using the IntelliScript Editor
  7. XMap
  8. Libraries
  9. Schema Object
  10. Command Line Interface
  11. Scripts
  12. Parsers
  13. Script Ports
  14. Document Processors
  15. Formats
  16. Data Holders
  17. Anchors
  18. Transformers
  19. Actions
  20. Serializers
  21. Mappers
  22. Locators, Keys, and Indexing
  23. Streamers
  24. Validators, Notifications, and Failure Handling
  25. Validation Rules
  26. Custom Script Components

User Guide

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()

0 COMMENTS

We’d like to hear from you!