Skip to main content Skip to complementary content

Creating a Job to split an XML file into three CSV files

Create a Job with an XML input and three CSV outputs.

Procedure

  1. In the Integration perspective of Talend Studio, right-click Job Designs > Standard and click Create Standard Job.
  2. Enter a name, purpose and description for your Job and click Finish.
  3. Add the following components:
    • A tFileInputRaw
    • A tHMap
    • Three tFileOutputDelimited
  4. 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.
  5. Double-click the tFileOutputDelimited components to configure their settings:
    1. For each component, enter the path for the output file in the File Name field.
    2. Select the Include Header check box.
    3. Edit the schema for the three components and add the following columns with the type String:
      • orderId
      • lastName
      • firstName
      • region
  6. Link the tFileInputRaw to the tHMap and the tHMap to the three tFileOutputDelimited components with row > Main connections.
    1. When prompted, enter a name for the output connections, APAC, EMEA and US for example.
    2. Click Yes when asked if you want to get the schema from the target component.
    The Job should look like this:
  7. In the Mapping perspective, create a structure based on the sample XML input.
  8. In your Job, double-click the tHMap to open the configuration wizard, then select Select an existing hierarchical mapper structure and click Next.
  9. 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.
  10. Click Finish.

Results

The map is generated and opens in the editor, you can now map your elements.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!