splitlines
RAW
,
PATTERN
,
LINE

The splitlines statement takes a chunk of text and splits it into two or more smaller chunks.


Parameters

This statement has three parameters:

raw – is the big chunk of text that you want to split into two or more smaller chunks.

pattern – is a template for taking the next slice out of the raw chunk of text. The pattern must be either one or two characters long. The first character tells Panorama how many lines long the next chunk should be (from 1 to 9 lines). You can also specify 0 lines, which tells Panorama to include all the remaining raw text. The second character, which is optional, specifies whether or not Panorama should force the text to upper case as it splits it. If this character is “U” or “u”, the line will be converted to all upper case. If this character is “W” or “w”, the first character of each word in each line will be converted to upper case. However, in either case this upper case conversion will happen only if the raw text being split off is entirely lower case to begin with. If the second character is not U or W the text will be left as is.

line – is the name of a field or variable where this slice of the raw text should be placed.


Description

The splitlines statement takes a chunk of text and splits it into two or more smaller chunks. The statement works by starting at the top and splitting off one or more lines at a time (hence the name splitlines).

Suppose you had, in a field or variable called Combined, an address like the one shown below and you wanted to split it up into individual fields.

John Wilson
ACME Widgets
1456 Redwood Blvd
Suite 2
Fullerton, CA 92631

The example below will quickly split the data into three chunks and store them in the three fields or variables, Name, Company and Address. (Note: The procedure could split these fields up further with the getname and getaddress statements.)

splitlines Combined,"1W",Name,"1W",Company,"0",Address

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.