Writing to multiple files - 8.0

Talend Data Mapper User Guide

Version
8.0
Language
English
Product
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2024-03-28

Create a structure that writes to different files.

About this task

In this example, you want to create a structure that inherits from two other structures and writes the output to two XML files.

Procedure

  1. Create a new empty structure with an XML representation.
  2. Create a root element, then create a child element named ShipNotice.
  3. In the ShipNotice element properties, click the ... button to the right of Inherits From and select Examples > Structures > Simple > POStandard > SimpleShipNotice.
    The child elements are automatically added under ShipNotice.
  4. Drag and drop a WriteURL function in the IO/Database tab of the ShipNotice element.
  5. Double-click WriteURL to define its properties:

    Example

    Property Value
    Representation XML
    URL URL to the file to write to, file:///c:/users/jsmith/documents/shipnotice.xml for example.
    Append Select this check box if you want to append this file at each execution.
  6. Create a new element named PurchaseOrders under the root.
  7. In the PurchaseOrders element properties, click the ... button to the right of Inherits From and select Examples > Structures > Paypal > PurchaseOrder2.
  8. Drag and drop a WriteURL function in the IO/Database tab of the PurchaseOrders element.
  9. Double-click WriteURL to define its properties:

    Example

    Property Value
    Representation XML
    URL URL to the file to write to, file:///c:/users/jsmith/documents/purchaseorders.xml for example.
    Append Select this check box if you want to append this file at each execution.
  10. Press Ctrl + S to save your structure.

Results

Your structure is created and configured to write to two different XML files, you can now use it in a map.