|
Usually, fields are used to insert the whole field value by enclosing the field name in curly brackets e.g.
Dear {name}
Sometimes, however, you may need to insert only part of a field's value. These constructs may be used:
| • | The name of the field may be followed by a colon and a number specifying the position of the first character to be extracted from the field. If a positive number is given, the first character is found by counting from the left. For example, if the field value is ABCDEFGH:
{field:6}
extracts the field value from character 6 onwards, omitting the first 5 characters: FGH.
If a negative number is given, the first character is found by counting from the right. For example:
{field:-4}
extracts only the last 4 characters of the field: EFGH. |
| • | This may optionally be followed by a further colon and the number of characters to be extracted, e.g.
{field:4:3}
extracts 3 characters starting at the 4th character from the left: DEF, and
{field:-4:3}
extracts 3 characters starting at the 4th character from the right: EFG.
Alternatively, when counting from the left (i.e. positive position numbers), a hyphen and an end character position number may be given, e.g.
{field:4-6}
extracts 3 characters ranging from the 4th to the 6th characters from the left: DEF. |
| • | A sub-string of a field may be specified; use the syntax
{field[n]}
to extract the "nth" sub-string. The sub-strings must be separated by space and may be enclosed in single or double quotes (this allows space characters in a sub-string).
Example: if a field named PERSON contained the value
Mr "John Smith" 1234
then
{person[1]} would be Mr
{person[2]} would be John Smith
{person[3]} would be 1234 |
| • | A specified line may be selected from a multi-line field. The syntax is
{filename[#n]}
Example: if ADDRESS were a 4-line field generated by the OCR plugin then
{ADDRESS[#2]}
would be the second line of the address. (Note the "#" character preceding the number; if it were omitted, {ADDRESS[2]} would return the second word of the address.) |
See also
Defining a composite field
|