Create a Job with an XML input and three CSV outputs.
Procedure
-
In the Integration perspective of Talend Studio,
right-click and click Create Standard Job.
-
Enter a name, purpose and description for your Job and click
Finish.
-
Add the following components:
- A tFileInputRaw
- A tHMap
- Three tFileOutputDelimited
-
Double-click the tFileInputRaw to open its properties and click the ... button to the left of the Filename field to select your input XML
file.
-
Double-click the tFileOutputDelimited components to
configure their settings:
-
For each component, enter the path for the output file in the File
Name field.
-
Select the Include Header check box.
-
Edit the schema for the three components and add the following columns with
the type String:
-
orderId
-
lastName
-
firstName
-
region
-
Link the tFileInputRaw
to the tHMap and the tHMap to the three tFileOutputDelimited components with connections.
-
When prompted, enter a name for the output connections,
APAC, EMEA and US for example.
-
Click Yes when
asked if you want to get the schema from the target component.
The Job should look like this:
-
In the Mapping perspective, create a structure
based on the sample XML input.
-
In your Job, double-click the tHMap to open the
configuration wizard, then select Select an existing hierarchical mapper
structure and click Next.
-
Select the structure you created as input and click Next, then click Next on
the next step.
The output structure is generated from the schemas created in the
tFileOutputDelimited elements.
-
Click Finish.
Results
The map is generated and opens in the editor, you can now map your elements.