# Delimited File Destination

Astera’s *Delimited File Destination* provides the functionality to write data to a delimited file. *Delimited File Destination* gives you the ability to control the structure and content of file including numeric, date, and Boolean formats, encodings, text qualifiers (quotes), and character sets. You can choose to create a new file or append data to an existing file.

### Video

{% embed url="<https://www.youtube.com/watch?v=MgV63tQqR0A>" %}

### Configuring Delimited File Destination Object

* To get a *Delimited File Destination* object from the Toolbox, go to *Toolbox > Destinations > Delimited File Destination*. If you are unable to see the Toolbox, go to *View > Toolbox* or press Ctrl + Alt + X.

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

* Drag-and-drop the *Delimited File Destination* object onto the designer.

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

The dragged destination object is empty right now. This is because the object has not been configured yet.

#### Mapping

For a *Delimited Destination* object to work, data fields should be mapped to the object so that the mapped data can be written to the destination.

* Configure the source object and place it onto the designer next to the *Delimited File Destination* object.

  **Note:** In this case a *Customers* sample table has been used from a *Database Table Source* to write to the *Delimited File Destination*.

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

* Now map the source object to the destination object by mapping the source parent node by dragging it to the destination parent node manually.

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

* You can also directly write the source layout to a *Delimited File Destination* through the source context menu of its parent node.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/RmpdiETrHpefqWVYs1co/1v2.png" alt=""><figcaption></figcaption></figure>

The fields are now mapped.

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

#### Configuration

1. To configure the *Delimited File Destination* object, right-click on the header, select *Properties* from the context menu and a dialog box will open.

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

Select the *Properties* option from the context menu and a dialog box will open.

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

2. Provide the *File Path*. This is where the delimited destination file will be saved.

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

3. The dialog box has some other configuration options. Let’s go over these options:

* *Options:*

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

* If the source *File Contains Header*, check the box to read headers from the source file.
* *Field Delimiter* - Allows you to select a delimiter from the drop-down list for the fields.
* *Record Delimiter* - Allows you to select the delimiter for the records in the fields. The choices available are carriage-return and line-feed combination, carriage-return and line-feed. You can also type the record delimiter of your choice instead of choosing the available options.
* *Encoding* - Allows you to choose the encoding scheme for the delimited file from a list of choices. The default value is *Unicode (UTF-8)*
* A *Text Qualifier* is a symbol that identifies where text begins and ends. It is used specifically when importing data.
* *Apply Text Qualifier to all Fields* will add the specified qualifier to all the fields that have been mapped

  Say you need to import a text file that is comma delimited (commas separate the different fields that will be placed in adjacent cells).
* Use *Null Text* to specify a value that will replace any null values in your data.
* Choose *Append to File (If Exists)* to append to an existing file or create a new file. Creating a new file will overwrite any existing file data.
* Check on *Hierarchical Destination* when the data in the source file needs to be sorted into hierarchies in the destination file.
* Check on *Write to Multiple Files* for the data to be saved to multiple files instead of one single file. This can be done within a single dataflow through the destination object and supporting transformations.

4. Once the data reading options have been specified in this window, click *Next*.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/74gteDsuOxgSVQv1aAsE/5.png" alt=""><figcaption></figcaption></figure>

The next window is the *Layout Builder*. On this window, the layout of the delimited destination file can be modified.

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

* To add a new field to the layout, go to the last row of the layout (Name column), which will be blank and double-click on it, and a blinking text cursor will appear. Type in the name of the field to be added and select the subsequent properties for it. A new field will be added to the source layout.

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

{% hint style="info" %}
**Note:** Adding a new field *(Email)* to the layout.
{% endhint %}

* To delete a field from the layout, click on the serial column of the row that is to be deleted. The selected row will be highlighted in blue.

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

{% hint style="info" %}
**Note**: Deleting the *Fax* field from the layout.
{% endhint %}

* Right-click on the highlighted line, a context menu will appear in which will have the option to *Delete*.

  ![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/sFXpcc3woXG5WuLyn9qx/8.png)

  Selecting *Delete* will delete the entire row.

  ![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/gQfEwV2wYN5sqntzJwL8/9.png)

  The field is now deleted from the layout and will not appear in the output.
* To change the position of any field and move it below or above another field in the layout, select the row and use Move up/Move down keys.

{% hint style="info" %}
**Note**: Find the Move up/Move down icons on the top left of the builder.
{% endhint %}

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/zRkk6LkEMmhviknoxhRO/10.png)

For example: To move the *Country* field right below the *Region* field, select the row and use the Move up key from the 9th row to the 8th row.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/PSWMw1uHNZdOOJ0Ksvja/11.png)

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/s6STyqNwzfsOG8liyxCy/12.png)

5. Once the object layout is configured, click *Next*. A new window will appear, *Config Parameters*, which allows you to further configure and define parameters for the delimited destination file.

Parameters can provide easier deployment of flows by eliminating hardcoded values and provide an easier way of changing multiple configurations with a simple value change.

{% hint style="info" %}
**Note**: If you want to specify parametrized values for *Field/Record Delimiter*, make sure to follow the same syntax of delimiters as in the dropdown menus of these options on the Properties window.
{% endhint %}

Parameters left blank will use their default values assigned on the properties page.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/QMPMqmIHfKy2ooOaEuzK/13.png)

6. Next a *General Options* window will appear. In this window:

* *Comments* can be added.
* *General Options* are given, which relate to processing of records in the destination file.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/MWwBzpEPdPSlHvQZUq0h/14.png)

7. Click *OK*.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/2btDT9Sp28PYFkSMXY23/15.png)

The *DelimitedDest* object is now configured according to the changes that were made in the properties window.

{% hint style="info" %}
**Note**: The changes that were made in this case are:

* Added a new field *Email* in the layout.
* Moved the *Country* field below the field *Region* field.
  {% endhint %}

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/wpp2kiovKchb5Sy8xvaf/16.png)

The *Delimited File Destination* object is successfully configured, and the destination file can now be created by running the dataflow.
