Expressions: Mapping options for List and File functions

Added in Q1 2024

The TextListMapping function allows you to take the elements of a text list and apply your selected mapping.

The TextListFromFile function also allows you to include optional mapping when reading a text list from a column in a file.

The options are:

MAPPING NO. AND NAME

 

DESCRIPTION

 

3. "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.

 

StrList(TextListMapping(CreateTextList("Hello", "World"), "RJZP",8)) -> "000Hello,000World"

 

   

4. "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.

 

StrList(TextListMapping(CreateTextList("Hello", "World"), "RJZP",8)) -> " Hello, World"

 

   

5. “PostDist5”

 

 

 

This mapping creates a string with the postcode turned into a 5 character postal district.

 

StrList(TextListMapping(CreateTextList("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), "PostCode5")) -> “CV34,M 20,SW 1A,B 1”

 

   

6. “PostDist4”

 

 

 

This mapping creates a string with the postcode turned into a 4 character postal district.

 

StrList(TextListMapping(CreateTextList("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), "PostCode4")) -> “CV34,M 20,SW1A,B 1”

 

   

7. “PostDistToPostDist5”

 

 

 

This mapping creates a string with the postal district turned into a 5 character postal district.

 

StrList(TextListMapping(CreateTextList ("CV34", "M20", "SW1A", "B1"), "PostDist5")) -> “CV34,M 20,SW 1A,B 1”

 

   

8. “PostDistToPostDist4”

 

 

 

This mapping creates a string with the postal district turned into a 4 character postal district.

 

StrList(TextListMapping(CreateTextList ("CV34", "M20", "SW 1A", "B1"), "PostDist4")) -> “CV34,M 20,SW1A,B 1”

 

   

21. “Upper”

 

 

 

This mapping creates a string with all lower case characters turned into upper case ones.

 

StrList(TextListMapping(CreateTextList ("Hello", "World"), "Upper")) -> "HELLO,WORLD"

 

   

22. “Lower”

 

 

 

This mapping creates a string with all upper case characters turned into lower case ones.

 

StrList(TextListMapping(CreateTextList ("Hello", "World"), "Lower")) -> "hello,world"

 

   

25. “PostArea”

 

 

 

This mapping creates a string with the postcode turned into a postal area.

 

StrList(TextListMapping(CreateTextList ("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), “PostArea”)) -> “CV,M,SW,B”

 

   

26. “PostSect”

 

 

 

This mapping creates a string with the postcode turned into a postal sector.

 

StrList(TextListMapping(CreateTextList ("CV34 4HD", "M20 2DF", "SW1A 4WW", "B1 1DF"), “PostSect”)) -> “CV34 4,M 20 2,SW 1A4,B 1 1”

 

   

34. “UpperNoSpaces”

 

 

 

This mapping creates a string with all lower case characters turned into upper case ones and then remove spaces.

 

StrList(TextListMapping(CreateTextList ("Hel lo", "wor ld"), "UpperNoSpaces")) -> "HELLO,WORLD"

 

   

35. “Proper”

 

 

 

This mapping creates a string with all words proper cased.

 

StrList(TextListMapping(CreateTextList ("HELLO", "world"), "Proper")) -> "Hello,World"

   

36. “TPSNoSpaces”

 

 

 

This mapping creates a string where all telephone numbers are TPS formatted and spaces removed

 

StrList(TextListMapping(CreateTextList ("01224-631892", "+441234567890"), "TPSNoSpaces")) -> "01224631892,01234567890"

 

   

 

Related topics: