One Star

Handling Dynamic Column in Talend

Hi,
Can we handle variable csv file in talend.
My input csv file will have 2 fixed columns and upto 10 variable columns.
eg: 
file1:name;account;val1;val2
file2: name,account,val1,val3,val5
file3: name,account,val2,val5,val1
I need to update the database with these values and default values for the missing columns.
5 REPLIES
Moderator

Re: Handling Dynamic Column in Talend

Hi,
Could you please take a look at document about: TalendHelpCenter:How to process changing data structure? to see if it is what you are looking for?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Handling Dynamic Column in Talend

Hi,
The document has example to read dynamic columns and load new table.
But my requirement is to update an existing table.
Is it possible to update an existing table.
Moderator

Re: Handling Dynamic Column in Talend

Hi,
What's your  existing table column structure? Fixed columns? Name and account?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Handling Dynamic Column in Talend

Hi,
My existing column Structure is 
name,account,val1,val2,val3,val4,.....,val10
But in the input files I may not receive values for all the "Val*" fields. and no of columns in the files is also variable.
sample input file : name,account,val3,val5,val6
I need to identify the field name in the input file and update appropriate column in my table for that name and account.
I tried to read the header and values separately using the dynamic data type , but how do I do a lookup on the header field and map it to the appropriate column in the database table.
input file is  a delimited file
name,account,val3,val5,val6
abc,12345,1,2,1
o/p Table:
name,account,val1,val2,val3,val4,val5,val6,val7,val8,val9,val10
abc,12345,0,0,1,0,2,1,0,0,0,0
Moderator

Re: Handling Dynamic Column in Talend

Hi,
Please take a look at this forum: http://www.talendforge.org/forum/viewtopic.php?id=27719 to see if it is OK with you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.