You are here: Functions > INSERT()

INSERT()

INSERT() inserts characters or blanks into a character string, in any position.

Use INSERT()to normalize data for formatting, for duplicate matching and for Join and Relations commands, which require identical fields.

For example, part numbers in one file may be in the format “12345” and in another file, “12-345.” You can use INSERT() to insert a hyphen (-) in position 3.

Function Format

INSERT(C1,C2,N)

INSERT() returns a string where the string C2 is inserted into the string C1, at the position N. If N is greater than the length of string C1, string C2 is placed at the end of string C1. If N is less than or equal to 1, string C2 is placed in front of string C1.

Examples

INSERT("abcde","XXX",2) = "aXXXbcde"

INSERT("abcde","XXX",8) = "abcdeXXX"

INSERT("abcde","XXX",0) = "XXXabcde"