Text Input Files Using Multiple Lines per Record

The Text connection can also read input records from multiple contiguous lines of text. A multiple line per record format requires that you specify an input record delimiter (a unique character or string of characters) to denote the end of one input record and the beginning of the next input record. Specify the input record delimiter in the Text connection. The record delimiter string can be up to 256 characters long. Usually the input record delimiter is a single character such as a form feed (\f) character or a paragraph symbol (¶).

The following example shows how the first three records from the single line example look in multi-line format. The input delimiter is a single character paragraph symbol.

IDN:566238744
Nm:Carol Ann Wilson
Tel:1025557746
Bal:4000098
Pmt:30000
Date:10-15-93

IDN:012358743
Nm:Nathan Varberg
Tel:1015552345
Bal:300000
Pmt:25000
Date:10-11-93

IDN:524135698
Nm:David Fein
Tel:1015553222
Bal:3559955
Pmt:102550
Date:09-30-93

To translate this multilined data, configure the ZID field description as follows:

Type: TYPE TEXT VALUE "Customer"
Idno: TYPE TEXT START 5 UNTIL "\nNm:"
Name: TYPE TEXT UNTIL "\nTel:"
Tel:  TYPE TEXT UNTIL "\nBal:"
Balance: TYPE NUMBER.2 "\nPmt:"
Payment: TYPE NUMBER.2 "\nDate:"
Date: TYPE DATE FORMAT MM.DD.yy

Notice the differences in this example compared to the single line per record example. Remember we are using a record delimiter of (0x14). We use the escape sequence (\0x14) to specify the special character record delimiter string in hexadecimal notation. (Refer to the ASCII/hexadecimal equivalence chart for these values.)

The UNTIL specifications are multiple character strings, also with a special escape sequence (\n) to allow description of the line feed characters that delimit the input field values. The sequence (\n) indicates a single new-line character.

Remember, the input record now spans several input lines. The IDNO field begins in column 5, after the "IDN:" label, and continues until the Text Connection encounters the string "\nNm:". The Text Connection processes subsequent fields similarly. Notice, as before, in the DATE field specification, the last field in the record does not have an UNTIL specification. The UNTIL specification is not needed because, when scanning for the end of the last value in a record, the Lotus® Connector for Text always stops at the end of the data record.