Bring multiple columns from csv into xml loop

Four Stars

Bring multiple columns from csv into xml loop

Hello,

i'm new to the talend and im trying to use Talend Open Studio for Data Integration for converting csv into an xml file. I ran into trouble because i am having multiple columns bullet1 - bullet20 which I want to bring into the loop custom-attributes. Basic idea is to use the flatfile columns to fill a new attribute in the xml with the content of the columns. I know whats showed on the image does not work, its just to demonstrate the problem. I got 20 input cols which should each create a xml node inside of custom-attributes.

 

Unbenannt.PNG

 

Any ideas on that?

 

 

Big thanks in advance!

i3

Forteen Stars

Re: Bring multiple columns from csv into xml loop

@kolfe since you need to concatinate columns like row3.bullets1 || row3.bullets2.

try in this way.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: Bring multiple columns from csv into xml loop

Thanks for your input. That doublepipe will throw an error: "The operator || is undefined for the argument type(s) java.lang.String, java.lang.String". I could use + to concat but that would put all togehther into the same node and not one custom-attribute node each.

Forteen Stars

Re: Bring multiple columns from csv into xml loop

yes you can use + to 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: Bring multiple columns from csv into xml loop

you can add into single node using +

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: Bring multiple columns from csv into xml loop

xml result should look like this:

...
<custom-attribute>{row3.bullets1}</custom-attribute>
<custom-attribute>{row3.bullets2}</custom-attribute>
<custom-attribute>{row3.bullets3}</custom-attribute>
<custom-attribute>{row3.bullets4}</custom-attribute>
...


not likes this

<custom-attribute>{row3.bullets1} {row3.bullets2} {row3.bullets3} {row3.bullets4}</custom-attribute>

 

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads