[resolved] row to column transformation

Highlighted
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

View solution in original post


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

View solution in original post

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog