# Sorting a delimited file

You can sort a file delimited file with a link to a tSortRow component. The tSortRow component sorts input data based on one or several columns of data, by sort type or order, for example.

## Before you begin

* You must have added and configured a tFileInputDelimited component (see [Configuring a component to read a delimited file](https://help.qlik.com/talend/en-US/sorting-a-file-talend-studio/8.0/Configuring%20a%20component%20to%20read%20a%20delimited%20filehttps://help.talend.com/en-US/reading-a-file-talend-studio/8.0/configuring-a-component-csv)).
* You must also have defined its schema (see [Defining a component schema to read a delimited file](https://help.qlik.com/talend/en-US/sorting-a-file-talend-studio/8.0/Defining%20a%20component%20schema%20to%20read%20a%20delimited%20filehttps://help.talend.com/en-US/reading-a-file-talend-studio/8.0/defining-schema-csv)).

## Procedure

1. In the Designer, add a tSortRow component.
2. Right-click the tFileInputDelimited component.
   1. Select Row &gt; Main
   2. Click on the tSortRow component to link the two.

      ![](https://help.qlik.com/talend/en-US/sorting-a-file-talend-studio/Resources/images/row_main2.gif)
3. Double-click the tSortRow component.
4. Click the […] button next to Edit schema.

   ![](https://help.qlik.com/talend/en-US/sorting-a-file-talend-studio/Resources/images/edit_schema.png)

   Because they are linked, the tSortRow component inherits the schema of the tFileInputDelimited component.
5. Click the plus button to add a sorting rule.
   ### Example
   1. In Schema column, select City.
   2. In sort num or alpha?, select alpha. ![](https://help.qlik.com/talend/en-US/sorting-a-file-talend-studio/Resources/images/sort_rule.png)
6. Optional: Click the plus button to add another rule.
   ### Example
   1. In Schema column, select Street.
   2. In sort num or alpha?, select alpha

## Results

You have configured the file delimited data so that it is sorted.