The scenario describes a Job that reads an input flow which contains names and states from a CSV file, replicates the input flow, then sorts the two identical flows based on name and state respectively, and displays the sorted data on the console.
Drop the following components from the Palette to the design workspace: one tFileInputDelimited component, one tReplicate component, two tSortRow components, and two tLogRow components.
Connect tFileInputDelimited to tReplicate using a Row > Main link.
Repeat the step above to connect tReplicate to two tSortRow components respectively and connect tSortRow to tLogRow.
Label the components to better identify their functions.
Double-click the tFileInputDelimited component to open its Basic settings view in the Component tab.
Click the [...] button next to the File name/Stream field to browse to the file from which you want to read the input flow. In this example, the input file is Names&States.csv, which contains two columns: name and state.
name;state Andrew Kennedy;Mississippi Benjamin Carter;Louisiana Benjamin Monroe;West Virginia Bill Harrison;Tennessee Calvin Grant;Virginia Chester Harrison;Rhode Island Chester Hoover;Kansas Chester Kennedy;Maryland Chester Polk;Indiana Dwight Nixon;Nevada Dwight Roosevelt;Mississippi Franklin Grant;Nebraska
Fill in the Header, Footer and Limit fields according to your needs. In this example, type in 1 in the Header field to skip the first row of the input file.
Click Edit schema to define the data structure of the input flow.
Double-click the first tSortRow component to open its Basic settings view.
In the Criteria panel, click the [+] button to add one row and set the sorting parameters for the schema column to be processed. To sort the input data by name, select name under Schema column. Select alpha as the sorting type and asc as the sorting order.
For more information about those parameters, see tSortRow properties.
Double-click the second tSortRow component and repeat the step above to define the sorting parameters for the state column.
In the Basic settings view of each tLogRow component, select Table in the Mode area for a better view of the Job execution result.