Creating a Job to combine two CSV files into a single XML file
Create a Job with two CSV input files, a tHMap component and an output file.
Procedure
In the Integration perspective of Talend Studio,
right-click Job Designs > Standard and click Create Standard Job.
Enter a name, purpose and description for your Job and click
Finish.
Add the following components:
Two tFileInputDelimited
A tHMap
A tFileOutputRaw
Link the tFileInputDelimited components
to the tHMap and the tHMap to the
tFileOutputRaw with Row > Main connections.
Click Yes when asked if you want to get the schema from
the target component.
Double-click your tFileInputDelimited components to configure them:
Click the ... button to the right of the
File name/Stream field and browse to your
input CSV files.
Click the ... button to the right of
Edit schema and add the columns present in
your CSV files, then click OK.
In this example, the tFileInputDelimited
component named customers should have a schema
with three columns named id,
name and city, and the
one named bills should have three columns named
customerId, billId and
price.
In the Header field, enter
1 to indicate that the first line of the CSV
file is a header.
In the Hierarchical Mapper, right click
Structures and click New > Structure.
Select Import a structure definition and click
Next, then follow the wizard to create a structure
based on an XML sample to use as an output.