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 that is 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 returns a value of "customer13.rpt" (in the Lookup_Value parameter). To obtain this Lookup_Value, the Look Up built-in script compares Lookup_Key to the "file keys" and returns 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 can 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.

Examples:

dog#

Matches "dog3" and "Mydog8acat". Does not match "dog" or "dogs3"

dog*7

Matches "dog7", "dog37" and ")dog/7PP". Does not match "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 can be run wherever processes are allowed, including alone in its own task.

Example #1

Fred wants to look up a specific internal folder based on the username that uploaded a file. If a record for a particular username cannot be found, log an error.

To perform this operation with MOVEit Automation:

  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 the process.
  4. Set process parameters:
  5. Configure the destination to:

Given the contents of "fred.txt" shown above, the following uploader usernames causes 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 wants to change the names that several of her files are saved as, but many file names already have the correct names.

To perform this operation with MOVEit Automation:

  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 the process.
  4. Set process parameters:
  5. Configure the destination to:

Given the contents of "nancy.txt" displayed above, the following filenames 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 wants to set FTP mainframe parameters based on the names of files MOVEit Automation has just downloaded. He wants to be able to handle both specific filenames (for example, "four.txt"), general extension (for example ".txt") and provide a "catch-all" value.

To perform this operation with MOVEit Automation:

  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 the process.
  4. Set process parameters:
  5. Configure the FTP destination to:

Given the contents of "ed.txt" displayed above, the following source file names 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 wants to scan an entire folder structure and transfer only the files that match names in his lookup table file. Files that do match should usually be renamed.

To perform this operation with MOVEit Automation:

  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 the process.
  4. Set process parameters:
  5. Configure the destination to:

Given the contents of "ralph.txt" displayed above, the following source file names 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)