You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2017-03-24 14:35:41

gnchishti
Member
7 posts

gnchishti said:

Iterate CSV file to set context variables for each row

Hi,
I am trying to set context variable values from csv file columns, i.e. each column has value for a context variable, any comments on how to do that ?

Offline

#2 2017-03-24 15:33:15

vapukov
Member
470 posts

vapukov said:

Re: Iterate CSV file to set context variables for each row

csv file must have only 2 columns one with name "key", second with name "value"
each row contain 1 key and 1 value

Offline

#3 2017-03-24 17:13:30

gnchishti
Member
7 posts

gnchishti said:

Re: Iterate CSV file to set context variables for each row

Thanks Vapukov for reply , Actually I need 4 columns to be substituted into 4 variable in one iteration, I tried that method using a properties files and tcontextLoad but it does not fulfill requirements

Offline

#4 2017-03-24 22:13:10

vapukov
Member
470 posts

vapukov said:

Re: Iterate CSV file to set context variables for each row

sorry, can understand - what is You problem with normal tContextLoad? I load 100 variables at one iteration

all simple:

  • plain csv file - JUST 2 columns "key","value", as many rows as You need - 4-6-10-999

  • tFileInputDelimited -> connect to next by Main connection

  • tContextLoad

Offline

#5 2017-03-30 06:50:27

gnchishti
Member
7 posts

gnchishti said:

Re: Iterate CSV file to set context variables for each row

thanks vapukov , really appreciated your reply, I understand we can set all context variables using key value map into context load but my problem is i need to iterate this for 20 times and in each execution new values will be assigned to 4 variables. so i am trying to iterate csv file with 4 columns and 20 rows.

Offline

#6 2017-03-30 09:31:00

vapukov
Member
470 posts

vapukov said:

Re: Iterate CSV file to set context variables for each row

think You mix context and normal csv file

why just not define csv file - as many columns as You need
than tFileInputCSV -> tFlowToIterate -> and use Your 1000 variables as You want

Context is context, and do not try to use it wrong

Offline

#7 2017-03-31 11:13:43

gnchishti
Member
7 posts

gnchishti said:

Re: Iterate CSV file to set context variables for each row

I have created separate file for each job and then used tFileList-->iterate-->tFileInputDelimited-->tContextLoad. 
thanks for your time smile

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy