Creating a Job script to consolidate a name list from CSV files using tMap - 6.5

Talend Job Script Reference Guide

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
task
Design and Development > Designing Jobs
EnrichPlatform
Talend CommandLine
Talend Studio
This example shows how to write a Job script to define a simple Job that will consolidate two CSV files into one based on a given column.

The Job will contain the following components:

  • two tFileInputDelimited components to read the source CSV files, one of which contains a list of people, and the other contains a list of family names.

  • a tMap component to consolidate the input data to get a list of names based on the id column.

  • a tFileOutputDelimited component to write the consolidated list into another CSV file.

The contents of the input files used in the example are shown below.

Content of the main input file list_people.csv:

id;name;age;city
1;James;75;Richmond
2;Bill;18;Austin
3;George;76;Topeka
4;Herbert;48;Raleigh
5;Woodrow;54;Annapolis
6;Ulysses;56;Frankfort
7;Ulysses;47;Bismarck
8;Woodrow;37;Montgomery
9;Theodore;44;Salem
10;Dwight;38;Little Rock
11;Herbert;26;Salt Lake City
12;Zachary;41;Harrisburg
13;Harry;31;Atlanta
14;Millard;34;Annapolis
15;Ronald;28;Jackson
16;Rutherford;18;Carson City
17;Richard;49;Salt Lake City
18;Woodrow;52;Providence
19;Millard;79;Raleigh
20;James;75;Sacramento

Content of the lookup file list_families.csv:

id;family
1;Cleveland
2;Roosevelt
3;Carter
4;Jefferson
5;Hayes
6;van Buren
7;Kennedy
8;Adams
9;McKinley
10;Buchanan
11;Jefferson
12;Adams
13;Grant
14;Pierce
15;McKinley
16;Clinton
17;Roosevelt
18;Adams
19;Fillmore
20;Fillmore

To create such a Job script, follow the procedures below.