The following scenario creates a three-component Job, reading data from an input file that is transformed using a map that was previously created in the Mapping perspective and then outputting the transformed data in a new file. It works with Talend Data Mapper metadata.
Copying an editable version of the example files
In the Mapping perspective, in the Data Mapper view, expand the Hierarchical Mapper node and the Other Projects folder, right-click Examples and then select Copy in the contextual menu.
In the Data Mapper view, right-click at the root of the Hierarchical Mapper node, and then select Paste in the contextual menu.
This copies an editable version of all the read-only example files to your local workspace.
Adding and linking the components
In the Integration perspective, create a new Job and call it tdm_to_tdm.
Click the point in the design workspace where you want to add the first component, start typing tFileInputRaw, and then click the name of the component when it appears in the list proposed in order to select it.
Do the same to add a tHMap component and a tFileOutputRaw component as well.
Connect the tFileInputRaw component to the tHMap component using a Row > Main link and rename it input, then connect the tHMap component to the tFileOutputRaw component using a Row > Main link and name it output. When you are asked if you want to get the schema of the target component, click Yes.
Defining the properties of tFileInputRaw
Select the tFileInputRaw component to define its properties.
In the Basic settings tab, click the [...] button next to the Filename field then browse to the location on your file system where the input file is stored, or enter the path manually between double quotes. For this example, use <PATH_TO_WORKSPACE>/<PROJECT_NAME>/Sample Data/CSV/PurchaseOrderPayPal/PayPalPO.csv.
Set the Mode as Read the file as a string, and leave all the other parameters unchanged.
Defining the properties of tFileOutputRaw
Select the tFileOutputRaw component to define its properties.
In the Basic settings tab, click the [...] button then browse to the location on your file system where the output file is to be stored, or enter the path manually between double quotes. Leave the other parameters unchanged.
Defining the properties of tHMap
Select the tHMap component to define its properties.
Click the [...] button next to the Map Path field to open the picker and select the map to use, Maps/CSV/POPayPalCsv_PO2, then click OK. This map transforms a CSV file into an XML file.
Check that Read Input As is set to Single Column.
Check that Write Output As is set to String (single column).