Previous Topic

Next Topic

Book Contents

Book Index

Look Up

"Look Up" looks up a key, usually expressed with a macro, against a text file filled with one column of keys and up to five columns of values.

For example, given a file name of "report56.txt" (in the Lookup_Key parameter) and the path to a file containing the following keys and values (in the Lookup_FilePath parameter), the Look Up built-in script would return a value of "customer13.rpt" (in the Lookup_Value parameter). To obtain this Lookup_Value, the Look Up built-in script would compare Lookup_Key to the "file keys" and return the related value from the first matching line.

report44.txt,customer01.ttk

report56.txt,customer13.rpt

report66.txt,customer87.lml

Input Parameters

Wildcards

Lookup keys may contain wildcards, except when "Require_Exact_Match" is in effect. The wildcard syntax is similar to Windows filename masks, with some enhancements:

Wildcard char

Meaning

*

Match zero or more of any character

?

Match exactly one of any character

@

Match exactly one alphabetic character

#

Match exactly one digit

anything else

Match exactly that character

Some examples:

dog#

Matches "dog3", but not "dog" or "dogs3"

dog*7

Matches "dog7", "dog37" and ")dog/7PP" but not "dog" or "do7".

Output Parameters

Notes

In most production cases, you will probably use macros such as "[OrigName]", "[OnlyName]", "[RelativePath]" or "[MID([OrigName], 2, 3)]" in your "LookUp_Key" parameter.

This built-in script may be run wherever processes are allowed, including alone in its own task.

Example #1

Fred would like look up a specific internal folder based on the username that uploaded a file. If a record for a particular username cannot be found, an error should be logged.

To perform this operation with MOVEit Central, Fred should...

  1. Create a "lookup table" file containing content similar to the following and save it as "d:\customer2folder\fred.txt"

    ' Format is username,folder

    jack,D:\blue\2134

    diane,D:\red\3734

    american,D:\blue\3357

    kids,D:\red\1651

    heartland,D:\red\2162

  2. Create a new task with a source, process, destination, and schedule.
  3. Select "Look Up" as his process.
  4. Set process parameters:
  5. Configure his destination to:

Given the contents of "fred.txt" displayed above, the following uploader usernames would cause the following values to be placed into the LookUp_Value parameter.

Uploader Username

LookUp_Value

diane

D:\red\3734

heartland

D:\red\2162

congress

(NONE - ERROR)

Example #2

Nancy would like to change the names that several of her files are saved as, but many file names will already bear the correct names.

To perform this operation with MOVEit Central, Nancy should...

  1. Create a "lookup table" file containing content similar to the following and save it as "d:\correctoddfiles\nancy.txt"

    ' Format is incoming filename, corrected filename

    JHJ45KK,nice_J45.dat

    JTE_KTR_67,nice_K67.dat

    K_P0KX_R89,nice_L89.dat

  2. Create a new task with a source, process, destination, and schedule.
  3. Select "Look Up" as his process.
  4. Set process parameters:
  5. Configure her destination to:

Given the contents of "nancy.txt" displayed above, the following filenames would cause the following values to be placed into the LookUp_Value parameter.

Source File Name

LookUp_Value

JHJ45KK

nice_J45.dat

hello.txt

hello.txt

K_POKX_R89

nice_L89.dat

K_pokx_R89

K_pokx_R89

Example #3

Ed would like to set FTP mainframe parameters based on the names of files MOVEit Central has just downloaded. He wants to be able to handle both specific filenames (e.g., "four.txt"), general extension (e.g., ".txt") and provide a "catch-all" value.

To perform this operation with MOVEit Central, Ed should...

  1. Create a "lookup table" file containing content similar to the following and save it as "d:\blocking\ed.txt"

    ' List specific filenames first

    four.txt,80,4

    ' Next, list specific extensions

    .txt,80,10

    .dat,133,5

    ' Finally, provide a catch-all case

    ' (this assumes all incoming filenames will contain a period)

    .,80,10

  2. Create a new task with a source, process, destination, and schedule.
  3. Select "Look Up" as his process.
  4. Set process parameters:
  5. Configure his FTP destination to:

Given the contents of "ed.txt" displayed above, the following source file names would cause the following values to be placed into the LookUp_Value and LookUp_Value2 parameters.

Source File Name

LookUp_Value

LookUp_Value2

four.txt

80

4

five.txt

80

10

six.dat

133

5

seven.rpt

80

10

Example #4

Ralph would like to scan an entire folder structure and only transfer files that match names in his lookup table file. Files that do match should usually be renamed.

To perform this operation with MOVEit Central, Ralph should...

  1. Create a "lookup table" file containing content similar to the following and save it as "d:\onlysome\ralph.txt"

    ' List specific filenames first

    ur.txt,rrr[OnlyName].xtx

    ' Next, list specific extensions

    .txt,[OrigName]

    .dat,[OnlyName].tad

  2. Create a new task with a source, process, destination, and schedule.
  3. Select "Look Up" as his process.
  4. Set process parameters:
  5. Configure his destination to:

Given the contents of "ralph.txt" displayed above, the following source file names would cause the following files to appear on the destination with the following names.

Source File Name

Destination File Name

four.txt

rrrfour.xtx

five.txt

five.txt

six.dat

six.tad

seven.rpt

(file ignored)