Reputation: 1008
I have two input files:
I already have a talend job that transforms the .xlsx file into an .xml file.
One node in the .xml file contains the
<stockLocationCode>SL213</stockLocationCode>
The output .xml file looks like this:
Now I need to replace every occurence of the stockLocationCode with the second column of the .csv file. In this case the result would be:
My talend job looks like this:
I use a tMap
component to put the columns of the .xlsx file into the right node of the output xml file.
But I do not know how I can peplace the StockLocactionCode
with the acutal full stock location using the .csv file. I tired to also map the .csv file with the tMap
component.
I would neet to build in a methof that looks at the current value of the node <stockLocationCode>
and loops over the whole .csv file until it find it in the first column of the .csv file and then replace the <stockLocationCode>
content with the content of the second column of the .csv file.
Performance is not important ;)
Upvotes: 0
Views: 72
Reputation: 8239
tMap
or tXMLMap
component, where you map your keys and add a new column with the second column of the csv fileProduct; Stock Location Code; CSV 2nd column data
Voila, you exchanged the columns.
Upvotes: 1