split two columns into multiple columns

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

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

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now