You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 16
Next »
COLUMN$ returns a column of text from a document
Syntax
- COLUMN$(Document$, StartPos%, Length%)
- COLUMN$(ColNo%, Document$, Delimiter$)
Arguments
Method 1
- Document$ is a document (a StrExp)
- StartPos is an integer number for the startposition of the column (a NumExp)
- Length% is the integer number of positions in the column (a NumExp);
Method 2
- ColNo% is the integer number of the column (a NumExp), in Document$ with Delimiter$ (both StrExp);
Remarks
- Method 1 removes all characters from a document left of StartPos and maintains the number of charachters per line corresponding with Length, if available.
- Method 2 returns a column indicated with ColNo from a table in a document of which the elements are delimited by a (group of) character(s).
- When using method 2, lines which do not include the delimiter are not parsed nor included in the output of this function.
- When a space is present as delimiter in the document, you should use the SPACE function instead of putting a space or " " in the syntax.
Examples
Let our document$ contain the following information.
Method 1
returns:
Which seems pretty impractical. For this document, method 2 turns out to be more useful.
Method 2
returns:
You can see that lines which do not include the delimiter are ignored.
Example knowledgebases
Download
An example knowledgebase of this function can be downloaded here.
Description
Input
The document which is used in the knowledgebase is the same as described in the examples above, and is located in the dataslot of .
The method is chosen by the user with the parameter.
Relations and constraints
The functionis defined in 2 ways, connected to constraints.
Constraint:
Constraint:
Solution
When running as top goal, the method is chosen and the corresponding parameters have to be filled in (starting position and length in method 1, column number and delimiter character in method 2). The result is as described above.
Quick links: Functions overview | Attribute overview | Constants overview | Dimensions overview