IBM Datacap, Version 8.1            

Text matching to locate fields

Frequently, a line item grid includes a total at the bottom. There might be other fields, like sales tax and shipping costs. Because you do not know in advance how many line items are in the grid, you cannot know where the other fields are located. Because the location of the other fields is unpredictable, you cannot use positional information to read these fields. Instead, you can use text matching to locate an adjacent label and then read the text beside the label.

Taskmaster provides many actions for locating text on a page. You can consider these actions in more detail in the topics about text matching. Typically, when you work with line item grids, you are searching for the last instance of a word or phrase like Total or Sales Tax. The Locate actions library has several useful actions, including the actions in the following table.
Library Action Description
Locate FindLastRegEx Locates the last occurrence of a word or phrase on the current page.
Locate FindLastKeyList Locates the last occurrence of a word or phrase that is contained in the specified keyword file. A keyword file is a text file with a .key extension that contains a list of similar words and phrases; for example, Sales tax and Tax.
Locate GoRightWord Moves n words to the right of the location of a previously found word.
Locate UpdateField Updates the current field in the page data file with the value of the located word.
For detailed information on these and other actions in the Locate library, select the action on the Actions Library tab and click Display information.

The following example rule first locates the last instance of the word Total on the current page. The rule then moves one word to the right and makes sure that the value is a currency value. Finally, the rule updates the current field in the page data file. The rule must be attached to the Total field in the document hierarchy.

Example ruleset that uses text matching to identify a Total field



Feedback

Last updated: November 2013
dcadg608.htm

© Copyright IBM Corporation 2013.