Pattern Count

Pattern Count is the number of patterns that ReportMiner matches on your file to capture a data region. This is useful if more than one pattern is required to identify the beginning of your data region. You can specify up to five patterns in a report model at a time.

In this document, we will explore how the Pattern Count feature helps with the selection of a data region.

Loading an Unstructured File

1. Open a Report Model in ReportMiner by going to File > New > Report Model.

Pattern-Count_1

2. Provide the File Path for the unstructured file from your directory.

Pattern-Count_2

ReportMiner supports extraction of unstructured data from Excel, csv, text, PRN, PDF, word, rtf and xls files. In this case, we are extracting data from a text file.

3. Click Open. A text file containing information regarding orders to a fictitious furniture store will open in the report model.

Pattern-Count_3

Now that the file is open, we will create an extraction template.

Creating a Report Model

1. Right-click on the Record node in Model layout under the Report Browser panel and select Add Data Region from the context menu.

Pattern-Count_4

A pattern-matching bar and Region Properties panel will appear. And a subnode “Data” is added to the Record node in the Model Layout tab.

Pattern-Count_5

2. Specify the pattern that the report model can look fot and match in your file to capture data. You can use an alphabet, character, number, word, a wild card or any combination of these to define your pattern.

Astera ReportMiner has built-in wild cards to facilitate region selection.

Pattern-Count_6

Wild Cards Description
à It matches any alphabet on the file.
Ñ It matches any digit on the file.
Æ It matches any alphabet or digit on the file.
__ It matches any non-blank character on the file.
[ ] It matches any blank character such as line, space, tab etc. on the file.

In this example, we want to capture the data highlighted in yellow. Notice that each item has a specific item code, which we can use as a pattern to extract all the item details.

Pattern-Count_7

3. The pattern is a combination of three alphabets, a hyphen, and five digits. You can use the relevant wildcards to specify the pattern. In this case, notice that some item-codes are different from this pattern. The digits in the codes appear before the alphabets. As a result, RUGS has not been captured in the data region.

Pattern-Count_8

4. In this scenario, to capture the region completely, we’ll specify another pattern. You can specify up to five patterns in a single data region. We’ll go to the Pattern Properties panel and increase the Pattern Count to 2. Another pattern bar appears.

Pattern-Count_9

5. On the second pattern bar, we’ll specify another pattern where the 5 digits come before the 3 alphabets, separated by a hyphen. Now, all the lines with item details have been captured completely in the data region.

Pattern-Count_10

6. Once our data region is defined, the next step is to create data fields. To do that, you can highlight each field area, right-click and select Add Data Field.

Pattern-Count_11

7. Repeat the process to create more data fields and name them as shown below.

Pattern-Count_12

8. Preview data by clicking on the Preview Data icon placed in the toolbar at the top of the designer window.

Pattern-Count_13

9. A window will open, asking you to save the file before proceeding. Save the report model at your required path.

Pattern-Count_14

10. Once saved, a Data Preview window will open, displaying a preview of the extracted data.

Pattern-Count_15

This concludes our discussion on working with an increased Pattern Count in Astera ReportMiner.