STRIPCOMPANY

Description

Returns the core company name, by removing all punctuation, any leading "The" , and key words such as Corp, Inc, etc.

Syntax

STRIPCOMPANY ( TextSourceField )

Parameter Description
TextSourceField The string containing the company name.

Remarks

See the table below for the list of words that will be removed by the function.

Examples

This function returns "Joseph Joseph":

STRIPCOMPANY("The Joseph & Joseph Corporation")

This function returns "TeleTronics":

STRIPCOMPANY("TeleTronics Co., Inc.")

How it works

The STRIPCOMPANY function returns the root company name by removing certain punctuation, extra spaces, any leading "The", and key words such as Corp. and Inc. The function processes the company name in several passes to remove these characters and return the root company name.

The function algorithm is as follows:

  1. It processes the entire string and deletes the following punctuation: period, dash, apostrophe.
  2. It finds the first word of the string and checks it against the company prefix list. A word is defined as a string with its following delimiter. The three delimiters are space, comma and ampersand. The company prefix list is stored in the STRIPCOMPANY table within the Scribe Internal database with a value of P in PARTTYPE column.

    If the word is in the company prefix list, the word is deleted from the string. If the word is not in the company prefix list, the word is put back into the string with no leading space and without its delimiter.

  3. It processes the remaining words in the string and checks it against the company suffix list. The company suffix list is stored in the STRIPCOMPANY table with a value of S in the PARTTYPE column.

    If the word is in the company suffix list, the word is deleted from the string. If the word is not in the company suffix list, the word is put back into the string with a leading space and without its delimiter.

Because of the way that a word is defined and the way the string is rebuilt from the words, one word at a time — without the delimiters, extra spaces, commas, and ampersands — is stripped out of the string.

The end result will be a string that has had commas, extra spaces, ampersands, apostrophes, dashes, and periods removed. It has also had company prefixes and company suffixes removed.

Note: Suffixes will be removed from anywhere in the string.

See also

PARSE

PARSEADDR

PARSENAME

STRIPCOMPANYSUFFIX