Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference WORD
Functions and Expressions Reference Guide
223
WORD
The WORD function returns the characters between two user-defined separators
within a text item. The separators are counted from left to right when the third
argument is positive, and from right to left when the third argument is negative,
enabling the function to search from either end of the item.
Syntax
WORD (single-text-expression , single-text-expression ,
single-integer-expression)
Meaning
WORD (text_to_search , word_separator ,
number_of_word_to_get)
Returns
This function returns a single-text-item.
Returns the characters ("word") between the nth-1 and nth word_separator,
where n corresponds to number_of_word_to_get.
Define the separator (word_separator) and specify the number of the
occurrence of that separator. The
WORD function returns the characters
between the nth-1 and nth separators in the delimited text item.
Note The separator is case sensitive.
Examples
The following examples assume that a file exists named Letter with two text
objects named Line1 and Line2 as follows:
Line1:Congratulations, Mr Brown! You’re a winner!;
Line2:You may have already won 1 million dollars!;
WORD ( Line1:Letter , " " , 3 )
In this example, the WORD function returns Brown! The exclamation point is
returned because it is read as a character within the word before the separator
(a space).