# Line Count

*Line Count* option in a report model in Astera enables users to specify the number of lines over which a data region spans. This feature is useful when transposing data that appears in rows in an unstructured file and convert it into vertical fields (columns) inside a report model.

In this document, we will explore how *Line Count* feature helps with the selection of a data region in Astera.

## Sample Use-Case

In this case, we have unstructured data in a PDF file.

Download the sample PDF file from the following link:

{% file src="<https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/lU4tkAdG3ymyhtlmolOS/Auto%20parsing%20file%20source>" %}

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/uUEPWFWOYp57kCvUKYDr/1_data.PNG)

This file contains a customer list report including their account name, contact, and address details.

You can see that a single record spans over 4 lines on this PDF file. In order to capture this data and place it into different fields, we will use the *Line Count* feature.

First, let's load this unstructured file onto the report model designer.

1. &#x20;Go to *File > New > Report Model* and select the source file from your directory.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/f0KIWLNh0W7aX3D0skz5/1%20file%20path.png)

There are many options available in the Report Options panel to configure how Astera reads the unstructured PDF file such as specifying the scaling factor, font, tab size, and password.

You can read about these options here.

2. Click *OK* and the source file will open on the designer.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/K3O0eBsIDYIA7plVixsQ/image.png" alt=""><figcaption></figcaption></figure>

&#x20;Now that we have loaded the source file in Astera, let's create an extraction template.

## Creating a Report Model

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

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/vQXNzBy7MOdQXCIlaQ3S/image.png" alt=""><figcaption></figcaption></figure>

A pattern-matching bar and Region Properties panel will appear and a *Data* node will be added under the *Record* node in the Model Layout panel.

2\. Specify a pattern with which Astera can match your source file to capture the desired data. You can use an alphabet, character, number, word, or a wild card or any combination of these to define your pattern.

In this case, write "ACCOUNT" in the pattern-matching bar as shown below.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/HTtWrYdTHQjOicaN9QmR/image.png" alt=""><figcaption></figcaption></figure>

You can see that only one field information is captured through matching pattern. In order to capture the data spanning over 4 lines, we must increase the *Line Count* to 4.

3\. Increase the *Line Count* value to 4 from the Region Properties panel.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/x1KGnourC2DlwPbFuqMR/image.png" alt=""><figcaption></figcaption></figure>

Each data region block contains information of a single record. Let's create data fields.

4\. Highlight the data region after "ACCOUNT:", right-click on it and select *Add Data Field* from the context menu. Rename it to *Account*.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/iz98GNsUAfDlnadBio8k/image.png" alt=""><figcaption></figcaption></figure>

5\. Repeat the process to create more data fields. You can see the layout of the extraction template in the Model Layout panel.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/ZjqAcCB6qA3e8YaCi7jX/image.png" alt=""><figcaption></figcaption></figure>

6\. You can preview data by clicking on the *Preview Data* icon placed in the toolbar at the top of the designer window.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/RRAJ7eJKw5bZTmCsiu9u/image.png" alt=""><figcaption></figcaption></figure>

A *Data Preview* window will open displaying a preview of the extracted data.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/HCzl26ju35fPo5yBvFF5/9%20output.png)

This concludes using the *Line Count* option while building an extraction template in Astera.
