# Fixed Length Parser

*Fixed Length Parser* processes a stream of fixed length data as an input and give elements as parsed output. This is useful when the source data is in text format (information is contained in a single field) and it needs to be put into multiple fields for further integration.

In this document, we will learn how you can use *Fixed Length Parser* in Astera.

### Sample Use-Case

The sample data that we are using is a fixed length text file containing customers’ information.

![](/files/6AqfxyRFwCgLm214mnsX)

Observe that all the information such as name, street number, street type, city, state, and zip code are concatenated in a single field. We want to parse the *Contact\_Details* field into *Name*, *Street Number*, *Street Type*, and other respective fields.

To parse the data into separate fields, we will use the *Fixed Length Parser* object in Astera.

#### Extracting Data

To parse the data, we first have to extract it. Since the data is stored in a continuous stream, can not extract it directly using a *Fixed Length File Source* object. Therefore, we will use a combination of transformations to get the desired outcome. The diagram below explains the process that we’ll be following, right from extraction to to parsing the data.

![](/files/a4srAGkJ46ENV8jCH2SO)

Let’s begin with extracting the data.

1. Go to *Toolbox > Transformations > Constant Value* and drag-and-drop the *Constant Value* object onto the designer.

![](/files/LF84AM5cplC4GgB89TBe)

2. Right-click on the object’s header and select *Properties* from the context-menu.

![](/files/acMfnnEKdN027DqbBLMK)

3. In the *Constant Value* field, provide the file path of the source file (file containing customers data in a stream). Click *OK*.

![](/files/rtRxyFmWlnfR9AYRgQ8s)

4. Next, go to *Toolbox > Function Transformations > Files > ReadFileText(String filePath) - String*, and drag-and-drop the object onto the designer.

![](/files/sGyHNd3p2hVZps2uhECP)

You an see that the dragged transformation object has two sub-nodes - *Input* and *Output.*

5. Expand the *Input* node and map the *Value* field from the *Constant Value Transformation* object to the *filePath* field inside the *Read File Text* object.

![](/files/E2Eoe6N29voYantipI3F)

This will redirect Astera to read the data from the given file path. Now we can use the *Fixed Length Parser* object to parse the text data into separate fields.

#### Using Fixed Length Parser

1. To get the *Fixed Length Parser* object, go to *Toolbox > Text Processors > Fixed Length Parser* and drag-and-drop the object onto the designer. Map the *Value* field, under the *Read File Text* object, onto the *Text* field inside the *Fixed Length Parser* object.

![](/files/EPUJWF7caqVO8qQmzuJj)

You can see that the dragged-object also contains an *Output* sub-node which is currently empty.

2. Configure the *Fixed Length Parser* object by right-clicking on its header and selecting *Properties*.

![](/files/pl2JdAY1upGEhN9xjIRL)

3. A properties window will open. Here you will see three options, make sure the first two options are checked.

![](/files/2xzfgDvijM8SbP3XqxU9)

4. Click *Next*, and you will be directed to a *Source Fields* window.

![](/files/y2i6PDMovarlUOYJsQts)

Here, you have to provide the name of each field that you want to parse the source date into, as shown below.

![](/files/WW2B9pGMvbsYBrAM8rfP)

5. Click *OK*. Now, expand the *Output* node inside the *Fixed Length Parser* object. You will see all the fields that you have created in the previous step.

![](/files/YB0sgqGWfKRVwbIzDClX)

6. Right-click on the object’s header and select *Preview Output* from the context menu.

![](/files/gg4C4DP3AiinITiakG27)

A *Data Preview* window will open. Expand the nodes, and you will see a parsed output of each record.

![](/files/SZpvRRsdSv0yopJTN520)

To store this parsed output, write it to a destination file.

#### Writing to a Destination

1. Right-click on the *Output* sub-node inside the *Fixed Length Parser* object, and go to *Write to > Excel Workbook Destination*. An *Excel Workbook Destination* object will be added to the dataflow designer with auto-mapped fields.

![](/files/C5leC3igAbFfcLIloGEq)

2. Configure settings for the *Excel Workbook Destination* object.

Learn how to configure settings for *Excel Workbook Destination* from [here](/dataflows/destinations/excel-workbook-destination.md).

3. Click on the *Start Dataflow* icon, located in the toolbar at the top, to create this destination file.

![](/files/Lvorb8Q4sLCWP6k4rVtx)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/dataflows/text-processors/fixed-length-parser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
