User Guide : Using Content Extraction Language : CXL Quick Reference : Built-in Functions
 
Share this page             
Built-in Functions
asc(s) returns the ASCII value of the first character of the string s
fix(num) returns the integer portion of a number
gsub(r, s, t) for each match of regular expression r in string t, substitute string s
initcaps(s) converts the first character of each word to upper case
int(n) returns the integer portion of a number
isNumeric(value) returns an indicator of whether the value is numeric
lcase(s) returns a string in all lower case
left(s, n) returns the left most n characters of the string s
length(s) returns the length of the string s as a number
logmessage(t, f, p1, p2) communicates messages through the Map Designer environment
ltrim(s) returns a string with any leading spaces removed
namepart("[h][f][m][mi][l][t]", "string") parses the name in string into name parts, title, first, middle, middle initial, last, suffix
readahead(i) reads in i bytes from the beginning of the current input file line
right(s,n) returns the right most n characters of the string s
rtrim(s) returns a string with any trailing spaces removed
sign(n) returns the sign of the number n
shift shifts the input fields left one field
skip(num) skips the next num lines before processing the next line
space(n) returns a string that consists of n spaces
split(s, a, r) splits string s into array a on reg expression r, returns no of fields.
string(n, s) returns a string of n first characters of the string s
sub(r, s, t) just like gsub(), but only the first matching substring is replaced
substr(s, i, n) returns the n-character substring of s starting at i
transliterate(src, tgt, s) translates string from the src character set to the tgt character set
trim(s) returns a string with all surrounding spaces removed
ucase(s) returns a string in all upper case
val(s) returns the numeric value of a string of characters
Operations
 
Operation
Operators
Example
Meaning
assignment
= +=
a += 2
a = a + 2
logical OR
||
a || b
1 if a or b is true, 0 otherwise
logical AND
&&
a && b
1 if a and b are true, 0 otherwise
array membership
in
j in a
1 if a[j] exists, 0 otherwise
string matching
~ !~
$1 ~ /go/
match if the 1st field contains go
relational
< <= == != >= >
a == b
1 if a is equal to b, 0 otherwise
concatenation
"x" + "z"
"xz"
add, subtract
+ -
a + b
sum of a and b
multiply, divide
* /
a * b
product of a and b
 
field
$
$n+1
value of the nth field plus 1
grouping
( )
(AB) + C
matches ABC, ABABC, ...