[resolved] row to column transformation

One Star

[resolved] row to column transformation

Hi,
Can anyone help me to do this row to column transformation:
Input file:
Col_A Col_B Col_C
1 2 3
4 5 6
7 8 9

Output file:
Col_A Col_B Col_C
1 4 7
2 5 8
3 6 9

I have tried with lots of components but i am not able to do that.
Thanks for your help !.

Accepted Solutions
One Star

Re: [resolved] row to column transformation

Hi,
Thanks for your answer AchyuthB. tPivotOutPutDelimited would help me but it process only one column.
I found the tTurnRow unofficial component and it do exactly that I want.
Best regards
andrelaurent

All Replies
Community Manager

Re: [resolved] row to column transformation

Hi
Here I show a demo job to achieve the request,
in.csv:
1;2;3
4;5;6
7;8;9
on tJavarow_1:
1;2;3
4;5;6
7;8;9

on tJavaRow_2:
globalMap.put("c1", input_row.line);

on tJavaRow_3:
globalMap.put("c1", input_row.line);

result:
Starting job forum16973 at 20:07 25/07/2011.
connecting to socket on port 3400
connected
.----.
|tLogRow_1|
|=--=|
|line|
|=--=|
|1 |
|2 |
|3 |
|4 |
|5 |
|6 |
|7 |
|8 |
|9 |
'----'
.--+--+--.
|tLogRow_2|
|=-+--+-=|
|c1|c2|c3|
|=-+--+-=|
|1 |2 |3 |
|4 |5 |6 |
|7 |8 |9 |
'--+--+--'
disconnected
Job forum16973 ended at 20:07 25/07/2011.

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] row to column transformation

Thanks a lot for your demo Shong.
I will try to adapt it for my needs.
Bests regards.
andrelaurent
One Star

Re: [resolved] row to column transformation

Hi shong,
I was able to create your demo job but it looks to have a little error on tJavaRow_3. I think the correct code is:
globalMap.put("c2", input_row.line);

But the result is not that I asked in my first post Smiley Surprised
I need this output file:
1;4;7
2;5;8
3;6;9
Since yesterday I am trying to adapt your job without success. Could you please help me.
Thanks a lot
andrelaurent
One Star

Re: [resolved] row to column transformation

Hi,
tPivotOutPutDelimited might help you.
Please refer the below link for more details.
http://www.talendforge.org/forum/viewtopic.php?pid=22194#p22194
One Star

Re: [resolved] row to column transformation

Hi,
Thanks for your answer AchyuthB. tPivotOutPutDelimited would help me but it process only one column.
I found the tTurnRow unofficial component and it do exactly that I want.
Best regards
andrelaurent
Community Manager

Re: [resolved] row to column transformation

Hi,
Thanks for your answer AchyuthB. tPivotOutPutDelimited would help me but it process only one column.
I found the tTurnRow unofficial component and it do exactly that I want.
Best regards
andrelaurent

Hi
Cool, I was wrong to your needs.;(
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

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

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download