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

Example

A data stream contains stock transaction data. The stream has the following structure:
  • The header begins with the string
    yy-MM-dd/
    , which is a date followed by a slash.
  • The header contains various data, followed by the string
    ENDHEAD/
    .
  • The repeating segments begin with the string
    TRANS HH:mm nnn/
    , where
    HH:mm
    is the time on a 24-hour clock, and
    nnn
    is a serial number of any length.
  • The data stream ends with the string
    END/
    .
The following is a sample data stream conforming to this specification, where
...
represents arbitrary data that must be parsed:
06-12-13/...ENDHEAD/TRANS 09:30 1...TRANS 09:30 2...TRANS 09:31 03...TRANS 09:32 14...END/
You can parse this stream by using a Streamer having the following schematic structure. Notice that the opening and closing markers are located by searching for a particular pattern or string.
Segment
Type
Opening Marker
Closing Marker
Header
Simple
[0-9][0-9]-[0-9][0-9]-[0-9][0-9]/
ENDHEAD/
Repeating
Simple
TRANS [0-9][0-9]:[0-9][0-9] [0-9]+/
none
Footer
Simple
END/
none