What is the Text Parser Tool?
Introduction to the Parse Text Tool
The Parse Text tool extracts specific data from variables populated by other steps and then maps the data to other variables for use in further steps.
Textual data to be parsed is first selected by dragging and dropping a variable containing the data from the Task Browser dialog box into the Parse Text configuration dialog box. The step then uses extraction rules to select the textual data to be extracted and mapped to other variables. These variables may then be used to automatically incorporate the extracted textual data into other steps.
Text Parser Tool Features
- Single or multiple extraction rules
- Map any available data to multiple variables
- Merge textual data dynamically into other steps
Parse Text Tool – Working with other Tools
The Parse Text tool is independent of any other tools used in a task. It only consumes and outputs variables that can be consumed by other BPA Platform tool.
The Text Parser Tool can consume the following objects outputted by other task steps:
- Variables (Text) — Textual data is extracted from selected variables
The Parse Text tool outputs the following which can be consumed by all tools:
- Variables (Text) — Textual data is mapped to selected variables for use in other steps
- Step Properties — A number of properties for the step are exposed in the Environment tab of the Task Browser dialog box
Text Parser Tool – Step Configuration
To add a new Parse Text step to an existing task, you either:
- Click and drag the Parse Text icon from the Task Browser to the task Design area.
- From the task’s Design tab, right-click on empty space and select Add > General > Parse Text.
For a detailed description of how to create new tasks, refer to the product help.
About the General Tab
The General tab is used to enter the following details for the step:
- Name — Enter a meaningful name for the stepTIP: If this task instance makes use of two or more Parse Text steps, ensure the Name used is unique for each individual step.
- Description — If required, enter a description of this step
About the Main Tab
The Main tab allows the creation of rules for selecting the text to be extracted and the variable to which the results are to be mapped.
The dialog box contains the items listed below:
- Data — The source textual data to be parsed is selected by dragging and dropping the appropriate variable from the Task Browser into the field.
- Rules — Displays a list of rules created for the step. Rules are processed in the order in which they are displayed in the table.
- Add — Opens the New Rule Properties dialog box to enable a new rule to be created.
- Edit — Edits an existing rule.
- Remove — Removes the selected rule from the table.
Use the Up and Down buttons to reorder the processing sequence of the rules.
Adding New Rules
The New Rule dialog is used to create a rule for extracting text from an existing variables and placing (parsing) it into another specified variable. You can also control the position of the cursor in a body of text to work in conjunction with a following rule.
The dialog box contains the following:
- Name — Enter a unique name for this rule
- Type — Provides the following rules:
- Extract between [C1] and [C2] — Extracts the text between the first occurrences of specific values, in the specified order
- Extract between word [N1] and word [N2] — Extracts the text between the first occurrences of specific words, in the specified order
- Extract lines [N1] to [N2] — Extracts the lines of text between two line numbers inclusive
- Extract after [C] to the end of line — Extracts the text after the first occurrence of a specific value to the end of the same line
- Extract after word [N] to the end of line — Extract the text after a specific word to the end of the same line
- Extract word [N] — Extracts a specific word
- Extract after word [C] — Extract the text after a specific word
- Extract after word [N] — Extract the text after a specific word (allows for a second rule of the same type)
- Extract before word [C] — Extract the text before a specific word
- Extract before word [N] — Extract the text before a specific word (allows for a second rule of the same type)
- Move to start — Move the cursor back to the start of the data
- Move to start of line [N] — Move the cursor to the start of a specific line number
- Move to end of Word [C] — Move to the cursor to the end of a specific word
- Move to start of Word [C] — Move to the cursor to the start of a specific word
- Move to end of Word [N] — Move the cursor to the end of a specific word
- Move to start of Word [N] — Move the cursor to the start of a specific word
- Move to end of character [N] — Move the cursor to the end of a specific character
- Move forward [N] characters — From its current position, move the cursor forward a specific number of characters
- Move back [N] characters — From its current position, move the cursor back a specific number of characters
- Parameters — Insert the values for the selected rule
- Variable output — Choose the variable to save the selected text to
- Remove leading spaces — Removes any spaces included at the beginning of the extracted text
- Remove trailing spaces — Removes any spaces included at the end of the extracted text
- Remove CR and LF — Removes any carriage returns (CR) or end of line (LF) characters that may be included in the extracted text
About the Options Tab
The Options tab allows you to define how errors in this step are handled at task runtime.
If an error occurs, you can decide whether the step should Continue processing, or terminate the step immediately (Abort Step).
If the step is aborted, you can choose to Continue processing onto the next step in the task, or terminate the whole task immediately (Abort Task).
In Separators, list those word separators that may be used in the body of text you are parsing. Default values are:
- comma (
- full-stop (
- semi-colon (
- colon (
- space ( )
- carriage return (
- new line (
- horizontal tab (
Note that to add a control key(carriage return, new line, horizontal tab, and so on), you must use the escape sequence — for more information, refer to the Microsoft article, Escape Key Sequences.