Picker is an auxiliary selector that allows you to filter out input based on the position of the object in the preceding selectors output.
It can flexibly convert various text types in the desired output format on the fly.
It has two parameters:
This selects the level on which the filtration is performed, and the output type.
- Number of group
This specifies the indexes of the extracted items.
Element indexes start at 1 in the forward direction and -1 in the reverse one (from the end to the beginning). You can also extract a range of items using the begin: end syntax
Consider the following data field to extract the phone number and email from a company info:
2. Parsing pipeline.
In the first step, the boundary selector extracts content from the defined region.
The phone number and email are the last two lines of the block. This will still be correct, regardless of how many lines the postal address can occupy.
Therefore, for the Picker selector we set the type as "lines" and the number of group is "-2: -1".
Expert mode keyword:
pick: type=Character|Paragraph|Line, NPicks the nth object out of the currently selected sequence of objects. The property
type is optional. If it is specified, the incoming sequence is grouped into the requested new object types before the nth object (of the required type) is picked.
Example (Expert mode)
pick: type=Line, -2:-1
Converts the previously selected sequence of characters or paragraphs into lines and then picks up the two last lines as the final result.
Output data format:
List of selectors