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

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

0 COMMENTS

We’d like to hear from you!