split two columns into multiple columns

Highlighted
Five Stars

split two columns into multiple columns

Hi,

Could you please tell how to split two columns into multiple   following scenario?

Consider a sample input file as below:

Id, String1,String2,String3,Date1,Date2,Date3

 

Expected Output:

Id,String1,Date1

Id,String2,Date2

Id,String3,Date3

 

 

--------------------------------------------------------------- 

I have tried concatenating all String columns -String1@String2@String3 into one column and used that column to normalize using tNormalize component. 

(But it is not what I expect)

Id,String1,Date1,Date2,Date3

Id,String2,Date1,Date2,Date3

Id,String3,Date1,Date2,Date3


Accepted Solutions
Eight Stars

Re: split two columns into multiple columns

Probably not the most efficient solution, but gets the job done as long as the positions for every element remains consistent in your input set. You wouldn't even need the last tJavaRow if you want your output as one column. 

1.png2.png3.png4.png5.png

Nine Stars

Re: split two columns into multiple columns

You can try below.

 

CR.PNGCR1.PNGCR2.PNGCR3.PNG

 

Regards,

Veeru Boppudi
Fifteen Stars TRF
Fifteen Stars

Re: split two columns into multiple columns

tSplitRow is here for that.
Just 1 component is needed in such a case.

TRF

All Replies
Nine Stars

Re: split two columns into multiple columns

How many columns you have in source?

is it 7 columns? 

 

Regards,

Veeru Boppudi
Five Stars

Re: split two columns into multiple columns

Yes 7 Columns.

For every ID, 3 records needs to be created.

Example:

1, Veeru, Karthik, Jay, 2018-06-30,2018-04-14,2018-05-01

 

Output:

1, Veeru, 2018-06-30
1, Karthik, 2018-04-14

1,Jay, 2018-05-01

Eight Stars

Re: split two columns into multiple columns

Probably not the most efficient solution, but gets the job done as long as the positions for every element remains consistent in your input set. You wouldn't even need the last tJavaRow if you want your output as one column. 

1.png2.png3.png4.png5.png

Nine Stars

Re: split two columns into multiple columns

You can try below.

 

CR.PNGCR1.PNGCR2.PNGCR3.PNG

 

Regards,

Veeru Boppudi
Fifteen Stars TRF
Fifteen Stars

Re: split two columns into multiple columns

tSplitRow is here for that.
Just 1 component is needed in such a case.

TRF

What’s New for Talend Spring ’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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download