Previous Topic: %LenNext Topic: %Lower


%LookUp

Reads a lookup table from the file <filename> and uses the values in the table to perform multiple search and replace operations on <expr>.

The file must contain two columns: the first containing a pattern string and the second containing a string to substitute for the pattern. The first and second columns are delimited by a comma (,), and the second column is ended by a carriage return. This macro then goes through each row of the lookup table and replaces each occurrence of the pattern that it finds in <expr> with the substitute value. The third parameter is optional and if set to true will restrict the comparison to whole word matches only.

Syntax

%Lookup(<filename>,<expr>[,true])

Syntax Example

%ForEachTable {

%Lookup(c:\erwin\Data Modeler\physname.txt,CUST)

%EntityName

}

Expansion

CUST

EMPL

MVS

Usage

Classified as a Miscellaneous macro.

Note: A section of the physname.txt file might look like this:

CUSTOMER,CUST

EMPLOYEE,EMPL

MOVIES,MVS