Fixed Length Node Path Syntax¶
Fixed length is a type of text file with columns having known fixed lengths, as compared to a character-separated (CSV) or tabular text file. A fixed length node path references a value beginning at the begin index and continuing for the specified width. The fixed length node path syntax conforms to the following pattern:
Node paths in this section can be used with getNode, getAllNodes, and other QIE functions that accept a nodePath parameter. See How Node Paths Resolve for behavior details and the Node Path Lookup Dialog to build and validate them interactively against a sample message.
| Begin Index, Width [ Row Index ] | ||
|---|---|---|
| Element | Required | Description |
| Begin Index | Required * | The index of the first character that corresponds to the fixed length column |
| Width | Required * | The width of the fixed length column |
| Row Index | Optional | 1) The row index (where the first row is index '1', the second row is index '2', etc.) or 2) An at sign (@) followed by a {begin index},{length} identifier for the given record and the expected value (@23,4=MR12 or @1,15=John) |
* Begin Index and Width are not required when specifying the root node identifier (/) as the node path
Fixed Length Node Path Examples:
Frederick magic 24 male
Rachael artist 55 female
Harry heart 20 male
Hermionie IQ 20 female
Ronald none 20 male
charms 20 female
Ginerva curse 19 female
| Fixed Length Node Path | Description |
|---|---|
| / | Returns the entire fixed length message |
| 1,15 | Returns 'Frederick ' |
| 1,15[1] | Returns 'Frederick ' |
| 1,15[2] | Returns 'Rachael ' |
| 16,7[1] | Returns 'magic ' |
| 16,7[5] | Returns 'none' |
| 1,15[@16,7=curse] | Returns 'Ginerva ' |
| 23,3[@1,15=Ronald] | Returns '20 ' |
Data Map¶
When working with Fixed Length messages, you may also specify a Data Map to be used with that message. The data map is a reference to a System Variable of type Table, the system variable must have the three columns defined as a minimum. They are 'name', 'offset', and 'length'. Any other columns found in the data map are ignored.
When attaching a data map to a fixed length message you can use the name as the reference to a value instead of a Begin Index and Width annotation.
For example, if you have a data map with the following:
Using the same sample message, do the following instead:
| Fixed Length Node Path | Description |
|---|---|
| / | Returns the entire fixed length message |
| name | Returns 'Frederick ' |
| name[1] | Returns 'Frederick ' |
| name[2] | Returns 'Rachael ' |
| skill[1] | Returns 'magic ' |
| skill[5] | Returns 'none' |
| name[@skill=curse] | Returns 'Ginerva ' |
| age[@name=Ronald] | Returns '20 ' |