MetaTool > Help > Extraction > Format Text

060-790 MetaTool Format – Format Text

With the MetaTool Format Text rule, you can convert text to different formats. For example, the license code in our example begins with letters indicating the category, followed by digits, like in “IN256411” and need to have a more readable format where the category is separated from the digits, like “IN-256411”.

With the Format text rule, we can alter the format of the text.

01 Format Text – Add Rule

Format Text is defined in the MetaTool Extract tab.

Press the Add button and select Format – Text to add the format rule.

The Format Text Setup window opens.

02 Format Text – Setup

In our example we will make use of the CB MetaTool Keyword Doc Sep job. This job is automatically installed when you install CaptureBites MetaTool.

We will first add an Advanced OCR rule for the index field “Full Text Last Page” and find the License Number from each document. Refer to the help pages of the Find Line with Mask / WordsFind line with Line number and Find Word with Mask / Words for more details.

The result looks like this:
We will change the format of the License Number value and convert it to a format with a separator symbol.  We select the index field “License#” that holds the text value we want to change.

Optionally, we enter a description.

03 – Output format: here you enter the format of the output text. In our case it’s ??-?????, which stands for 2 characters, a “-“ separator and 5 characters. You can enter any character you want as a separator symbol except for “?”. You can also press the Setup button to select different format types to compose your output text format.
04 – Alignment: here you select whether you would like to format starting from the left side of the text or starting from the right side of the text.

For example:
The output format is ??
The input value is BE520332WOM
“Left” option is selected:
BE520332WOM will be converted to BE

The output format is ???
The input value is BE520332WOM
“Right” option is selected:
BE520332WOM will be converted to WOM

Using this approach you can extract segments from a value.

For example, if you want to extract the numeric part in BE520332WOM (positions 3 to 8), then: 

First use text format ???????? from “Left” to get BE520332
Next use text format ?????? from “Right” to get 520332

05 – Example: here you can enter a text to test the text format.
The final result will look like this: