Output (Transform) text formats
[start]
[start, end]
[index, ‘delimiter’]
[start; len]
These formats are used to extract a sub-string from the original index value.
[start] — used to extract a sub-string starting at the position start to the end of the original value.
If start is a positive number, the start position will be counted from the beginning of the original value.
If start is a negative number, the start position will be counted from the end of the original value.
If start is 0 or *, the start position will be the beginning of the original value.
Examples
[5]
Description — get sub-string from the 5th character to the end of the original value.
“ABCDEFGHIJKL” “EFGHIJKL”
“1234567890” “567890”
“1234” “”
[*]
Description — get full string
“ABCEDFG” “ABCDEFG”
“1234567” “1234567”
[start, end] — used to extract a sub-string starting at the position start and ending at the position end of the original value.
-
If end is a positive number, the end position will be counted from the beginning of the original value.
-
If end is a negative number, the end position will be counted from the end of the original value.
-
If end is 0 or *, the end position will be the end the original value.
-
If the start position is after the end position, the sub-string will have the reverse order of the original value.
Examples
[1, 2]
Description — get sub-string from the 1st character to the 2nd character of the original value.
“ABCDEFG” “AB”
“123456” “12”
[-4, -1]
Description — get sub-string from the 4th from the last character to the last character of the original value.
“ABCDEFGHIJK” “HIJK”
“1234567890” “7890”
[*, 5]
Description — get sub-string from the 1st character to the 5th character of the original value.
“ABCDEFGHIJK” “ABCDE”
[5,2]
Description — get sub-string from the 5th to the 2nd character in reverse order of the original value.
“ABCDEFGHIJK” “EDCB”
“1234567890” “5432”
[2, -2]
Description — get sub-string from the 2nd character to the 2nd from the last character of the original value.
“ABCDEFGHIJ” “BCDEFGHI”
“1234567890” “23456789”
“AB” “BA”
“A” “A”
[index, ‘delimiter’] — used to extract the element at the position specified by index where each element in the index data is separated by the character delimiter. The first element is index 1.
This transform expression is especially useful when assigning data elements in a PDF417 bar code to different index fields. It is also useful when assigning different lines of multi-line OCR results to different index fields. The delimited produced by multi-line OCR is the carat (^) character.
Examples
[2, ‘^’]
Description — get the 2nd element in the multi-line OCR where elements are separated by the character ‘^’
“John Smith^123 Main Street^Some City” “123 Main Street”
[3, ‘*’]
Description — get the 3rd element from the PDF417 barcode where elements are separated by the character ‘*’
“John Smith*123 Main Street*Some City” “Some City”
[start; len] – used to extract a sub-string for the position start for len characters.
Examples
[2;3]
Description — get sub-string from 2nd character with a length of 3 characters.
“ABCDEFGHIJ” “BCD”
“1234567890” “234”
“AB” “B”
“A” “”
See also: