Error getting tags :
error 404Error getting tags :
error 404 split | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
split
Basics
Expander triangle
Type
Command
Syntax

split variable {by | using | with} primaryDelimiter [and secondaryDelimiter]

split variable { by | using | with} {row | column}

Introduced
1.1
Changed
2.8.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Transforms a list into an array.
Examples

split it by return
split currentRisks by tab and ";"
split myTable by row
split myTable by column

Additional Comments
Expander triangle

Use the split command to place a list in an array so you can easily address each part of the list.

Parameters:

The variable is any variable that is not an array.

The primaryDelimiter is a character whose ASCII value is in the range 1 to 127, or an expression that evaluates to such a character.

The secondaryDelimiter is a character (other than the primaryDelimiter) whose ASCII value is in the range 1 to 127, or an expression that evaluates to such a character.

Comments:

The split command separates the parts of the variable into elements of an array. After the command is finished executing, the variable specified is an array.

If the first form of the command is used, the parts that become elements are defined by the primaryDelimiter. For example, if the primaryDelimiter is return, each line of the variable becomes an element in the resulting array.

If you don't specify a secondaryDelimiter, then a simple numeric array is created, with each key being a number, starting with 1.

If you specify a secondaryDelimiter, the key for each element is the first portion of each part of the variable, separated from the element's content by the secondaryDelimiter. For example, if the primaryDelimiter is return and the secondaryDelimiter is space, the remainder of each line of the variable is placed in an array element whose key is the first word of the line.

For example, the following statements create an array:

put "A apple,B bottle,C cradle" into myVariable

split myVariable by comma and space

The resulting array looks like this:

KEYVALUE

A apple

B bottle

C cradle

Important! Using the split command can discard data if any of the keys in the original variable are duplicated. If more than one part of the variable delimited by the primaryDelimiter has the same first portion delimited by the secondaryDelimiter, only the element corresponding to the first part is created. (For example, if you are splitting a variable by return and space, and two lines happen to have the same first word, only one of the lines is retained in the array.) Only one element is created for each unique key.

If the second form of the command is used, the string is split into elements of an array where each element using the rowDelimiter or columnDelimiter, where each element of the resulting array is a row or column of the string respectively.

Splitting a string by row converts the string into an array where each element of the array corresponds to a row in the string separated by the rowDelimiter.

Splitting a string by column converts the string into an array where each element of the array corresponds to a column in the string separated by the columnDelimiter.

User Comments
Expander triangle
User thumbnail
MikeKerner@RMKCo.com
StarStarStarStarStar
Dec 9, 2010
Split only creates a single-dimensional array.