Delimited Parser

The Delimited Parser in Astera Centerprise reads and processes a single stream of text in delimited format as input and returns its elements as parsed output. It enables users to transform an otherwise semi-structured data into a structured format.

In this document, we will learn to use the Delimited Parser to parse an incoming text stream in Astera Centerprise.

Use Case

In this case, we are using the Delimited File Source to extract our source data. You can download this sample data from here.

1_delimited_source

The source file contains customers’ contact information including their name, address, postal code, phone number, etc.

sourcedata

Upon previewing the data, you can see that it is difficult to decipher fields and elements since the data is in a single text stream with fields and records separated by delimiters. To make sense of this data, each records needs to be parsed into its elements in respective fields.

To do this, we will use the Delimited Parser object.

Using Delimited Parser

1. To get the Delimited Parser object, go to Toolbox > Text Processors > Delimited Parser and drag-and-drop the object onto the designer.

parser_object

You can see that the dragged object contains a single Text field.

2. Map the Customer_Info field inside the source object onto the Text field inside DelimitedParser object.

2_mapping

3. Right-click on the object’s header and select Properties.

3_properties

A configuration window will open as shown below.

4_configuration_window

Let’s look at the properties on this window.

  • Parse Data Pattern – Contains three patterns in which the dataset can be parsed:

    5_pattern

    • Single Record – Data is parsed into a single record with multiple fields. Users need to provide a field delimiter, and a text qualifier, if necessary.
    • Multiple Records – Data is parsed into multiple records with a single or multiple fields. Users need to provide a field delimiter as well as a record delimiter.
    • Field Arrays – Data is parsed into an array of records and fields. Users need to provide a field value delimiter and an array separator.

The source data in this case contains multiple records with many different fields. Therefore, we will set the Parse Data Pattern option to Multiple Records.

4. Provide a Field Delimiter and a Record Delimiter. The source file also contains a Text Qualifier.

6_properties_for

Click Next. This is the Layout Builder screen.

7_layout_builder

5. Here, write the names of the fields that you want to create.

8_creating_fields

Click OK. The Delimited Parser object now has new fields in the Output node.

11_output_fields

To preview data, right-click on the object’s header and select Preview Output from the context menu.

9_preview_output

A Data Preview window will open. Upon expanding the records, you can view the parsed output.

10_Data_Preview

To store this parsed output, you can write it to a destination file or use it for some transformation further in the dataflow.

This concludes using the Delimited Parser in Astera Centerprise.