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

How Anchors and Delimiters Work Together

How Anchors and Delimiters Work Together

You can define the anchors in the example source document. The Parser learns how to parse the document by examining the anchors and the delimiters that separate them. For more information about delimiters, see Formats Overview.
For example, suppose you have specified that your document uses a tab-delimited format. A line in the example source reads
First name:<tab>Ron
where
<tab>
is a tab character.
You can define
First name:
as a
Marker
anchor. You can define
Ron
as a
Content
anchor. The Parser learns from these definitions that it should search a source document for the string
First name:
. It should then skip over a single tab delimiter and retrieve the text that follows the tab.
Suppose you run the Parser on another source document, which contains the following text:
First name:<tab>Jack
The Parser finds the anchors as above and retrieves the text
Jack
.
Now suppose that the source document reads:
First name:<tab>Jack<tab>Age:<tab>34
The Parser still retrieves the text
Jack
, rather than
Jack<tab>Age<tab>34
. This works because you have defined the tab character as a delimiter. The Script understands that the
Content
anchor starts after the first tab and ends before the second tab. Of course, you might define additional anchors that retrieve Jack's age, which is
34
.
The above examples describe one possible behavior of the anchors and delimiters. The anchors have many properties that let you alter this behavior. For instance, you can define a
Content
anchor that ignores tabs, even in a tab-delimited format. For more information, see How a Parser Searches for Anchors.


Updated September 26, 2018