List and file mapping
You can apply a mapping to text list elements in two functions:
-
The
TextListMappingfunction allows you to take the elements of a text list and apply your selected mapping. -
The
TextListFromFilefunction also allows you to include optional mapping when reading a text list from a column in a file.
Available options
The available mapping options are described below. The example results show each space as an underscore (_).
RJZP
Right Justified Zero Padded
Must be used with the mapping size parameter.
This mapping creates a string of the mapping size with '0' characters at the start.
Example:
This expression returns 000Hello,000World
RJBP
Right Justified Blank Padded
Must be used with the mapping size parameter.
This mapping creates a string of the mapping size with ' ' characters at the start.
Example:
This expression returns ___Hello,___World
PostDist5
This mapping creates a string with the postcode turned into a 5 character postal district.
Example:
StrList(TextListMapping(CreateTextList("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), "PostDist5"))
This expression returns CV34_,M_20_,SW_1A,B__1_
PostDist4
This mapping creates a string with the postcode turned into a 4 character postal district.
Example:
StrList(TextListMapping(CreateTextList("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), "PostDist4"))
This expression returns CV34,M_20,SW1A,B__1
PostDistToPostDist5
This mapping creates a string with the postal district turned into a 5 character postal district.
Example:
StrList(TextListMapping(CreateTextList ("CV34", "M20", "SW1A", "B1"), "PostDistToPostDist5"))
This expression returns CV34_,M_20_,SW_1A,B__1_
PostDistToPostDist4
This mapping creates a string with the postal district turned into a 4 character postal district.
Example:
StrList(TextListMapping(CreateTextList ("CV34", "M20", "SW 1A", "B1"), "PostDistToPostDist4"))
This expression returns CV34,M_20,SW1A,B__1
Upper
This mapping creates a string with all lower case characters turned into upper case ones.
Example:
This expression returns HELLO,WORLD
Lower
This mapping creates a string with all upper case characters turned into lower case ones.
Example:
This expression returns hello,world
PostArea
This mapping creates a string with the postcode turned into a postal area.
Example:
StrList(TextListMapping(CreateTextList ("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), "PostArea"))
This expression returns CV,M_,SW,B_
PostSect
This mapping creates a string with the postcode turned into a postal sector.
Example:
StrList(TextListMapping(CreateTextList ("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), "PostSect"))
This expression returns CV34_4,M_20_2,SW_1A4,B__1_1
UpperNoSpaces
This mapping creates a string with all lower case characters turned into upper case ones, and then removes spaces.
Example:
This expression returns HELLO,WORLD
Proper
This mapping creates a string with all words proper cased.
Example:
This expression returns Hello,World
TPSNoSpaces
This mapping creates a string where all telephone numbers are TPS formatted and spaces removed.
Example:
This expression returns 01224631892,01234567890
Related topics
For more about the functions that use these mappings, see: