# Defining the Start Position of Data Fields

*Start Position* options are useful for defining the start position of a selected data field. They appear in the *Size and Position* group-box in the Field Properties panel. There are three options available in the drop-down menu of the *Start Position* option:

1\. *Fixed*

2\. *Follows String in Current Line*

3\. *Follows String in Previous Line*

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/1x89ksKUtgrXLciXmUed/Start-Position_0.png)

In this document, we will discuss how to work with the *Follows String In Current Line* and *Follows String In Previous Line* options to define the start position of a data field.

{% embed url="<https://youtu.be/3C-Y5BPSnAA>" %}

### Loading An Unstructured File

Before creating an extraction template, we need to import the unstructured source file that we want to extract data from in Astera.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/8mqARaiHIRyEIFgsMu41/Start-Position_1.PNG)

The Report Options panel provides the configuration options for loading the unstructured file. You can change the source file by specifying its *Path* in the *Data File Location* group-box.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/N8rJbiifzYS25IkSyytw/Start-Position_2.PNG)

There are also some other configuration options. To learn more about the Report Options, click [here](https://documentation.astera.com/report-model/report-model-interface/report-options).

### Creating the Report Model

Add a new [data region](https://documentation.astera.com/report-model/report-model-interface/data-regions-in-report-models) and [specify an appropriate pattern](https://documentation.astera.com/report-model/use-cases/applying-pattern-to-line) to capture all the lines in that region.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/CQAtukeixFsV8jkUOHYR/Start-Position_3.PNG)

Here, we have defined the pattern as ‘ACCOUNT:’ and the *Region End Type* is set to *Another Region Starts*, which means that the current data region will end when another one starts.

### Using Start Position Options to Capture Data Fields

We have captured the data region of our interest in the report model. Let’s extract relevant data points by *Adding Data Fields.*

1\. To create the data field, highlight the desired field area, right-click on it and select the *Add Data Field* option from the context menu.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/pjGEusE3njXA0m0511Ai/Start-Position_4.png)

2\. As you can see below, the data is misaligned and therefore is not being captured correctly.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/XmTO9nLffAunYX0tl7Ut/Start-Position_5.PNG)

3\. To solve this problem, we can use the *Follows String in Current Line* option from the *Start Position* drop-down menu in the Field Properties panel to specify a string which defines the start position of this field.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/EqN9SBIZNPXxKUEfAT2g/Start-Position_6.PNG)

Here, we have defined ‘contact:’ as the string in the textbox and *Length Till End Of Line* to define the start position. Now, all the data points in this field have been captured completely.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/wpLYCNFmAUmvwvpBc7YS/Start-Position_7.PNG)

4\. Notice that two checkboxes, *Case Sensitive* and *Regular Expression,* have appeared in the Field Properties panel.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/XwxrnkywVrbIfcMxFQpW/Start-Position_8.PNG)

*Case Sensitive:* Allows users to search the specified string on a case sensitive basis.

*Regular Expression:* Allows users to use a regular expression to search the preceding string of the data field.

5\. Let’s go ahead and select the *Case Sensitive* option and see what happens.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/OEJNP9r5IA5Lkg3kkabb/Start-Position_9.PNG)

The fields are no longer being captured as they are no longer highlighted in blue. This is due to the case sensitive comparison of the two strings ‘CONTACT:’ and ‘contact:’ (they are currently not matching due to the difference in upper and lower cases). Uncheck the *Case Sensitive* option.

6\. Select the *Regular Expression* checkbox and define a regular expression in the textbox to capture the data points.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/T8PlRFWhHRRaFXXmY8xu/Start-Position_10.PNG)

The data is now being captured correctly.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/WFGiRIrfeRzjq7DQkeDA/Start-Position_11.PNG)

7\. Next, capture the data points for the field, *Address*. This time, define the *Start Position* as *Follows String in Previous Line* as the address starts from the following line of the string ‘ADDRESS:’.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/7mTHwxeNblu0RtpGyS2J/Start-Position_12.PNG)

Notice that we have matched the case of the string specified in the textbox with the case of the string in the document since the *Case Sensitive* checkbox is selected. Therefore, the data is being captured correctly.

8\. Lastly, capture the data in the field *Account*, by using the *Follows String in Current Line* option.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/QKdtcnh9HJzjFikTNj8a/Start-Position_13.PNG)

9\. You can rename the fields in the *General* section of the Field Properties panel. This is what our Model Layout looks like:

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/XoYM2Mhyeba3BKIGXft2/Start-Position_14.PNG)

10\. Preview the data by clicking on the *Preview Data* icon to check if all the fields are being extracted correctly from the unstructured document.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/NhrpYobIWEJ66KBkAYd9/Start-Position_15.png)

The *Data Preview* window shows the data extracted from the unstructured document.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/XsJS7FYoCxf3ToOLkTao/Start-Position_16.PNG)

This is how we can extract data from an unstructured file by specifying *Start Position* options in Astera.
