How to change column name dynamically and assign corresponing value

Highlighted
One Star

How to change column name dynamically and assign corresponing value

I have below scenario...
Input-
id field1  field2
1   abc      A1
1   pqr      B1
1   xyz      C1
Output-
for first row -
id   A1
1    abc
for second row-
id   B1
1    pqr
for third row-
id   C1
1    xyz
Here,
A1,B1,C1 are values in input file. but, in output we want it as a column name(should change dynamically)
and also I am assigning corresponding values from field1 to A1,B1,C1
Regards,
Kiran
Community Manager

Re: How to change column name dynamically and assign corresponing value

This isn't exactly what you want, but given what you have said I think that a solution like this will work for you. I have written a tutorial on writing a job which can deal with a dynamic column order. You can find it here.
One Star

Re: How to change column name dynamically and assign corresponing value

Thanks Rilhia for your response...
Your Blog is very helpful. but I want to change/set column name dynamically for each row. don't get wondered...It's my requirementSmiley Happy
Actually I could achieve this using tPivotToColumnsDelimited component. but I want to change the column name on the fly.
If you have any clue please suggest...

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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 Quality

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

Download