Return to String Function Index
String Function Syntax and Examples
LPAD( )The LPAD() function adds a specified character to the left side of a string to achieve the specified length. If length is less than the length of string, the original string is returned.
Syntax:
LPAD(string,length,char)
where:
- string is the string you want to pad
- length is the desired number of characters for the string
- char is the character to be used to pad the string. If a string or expression is specified, the first byte will be used.
Example:
input: samplestring
IMPORT @sample.dat
{RECORD
{
field1 *\r\n
}
schema1.table1
{
col1 LPAD(field1,17,'A')
col2 LPAD(field1,6,'A')
}}
Results:
schema1.table1.col1 AAAAAsamplestring schema1.table1.col2 samplestring Return to String Function Index