Reading param context from an excel sheet

Highlighted
Six Stars

Reading param context from an excel sheet

Hi All,

 

I have a job where it is taking 3 context param from an excel sheet:

1. .schema file

2. Data File

3. Output File

 

I was thinking if it's possible to take these 3 context from a .xls file as it is running for mutiple times.

The .xls file will have these information and there's like thousand over information and I do not want having to change the context_param manually each time.. :

 

Is there a way we can automate the job to take the context param from the excel sheet and run it?

 

SCHEMADATA_FILEOUTPUT
I:\Schema\users.schemaI:\Data_File\users_data.txtI:\Output\Output1.txt
I:\Schema\users1.schemaI:\Data_File\users1_data.txtI:\Output\Output2.txt

 

Any help would be great, thanks.


Accepted Solutions
Forteen Stars

Re: Reading param context from an excel sheet

generally - yes

 

variant 1 - read file with Input component and connect it to tFlowToIterate

tFlowToIterate automatically store each column to the global variable.

then do all other steps as iteration. You will have a loop for each row, on each iteration you can use correspondent values with (example) (String)globalMap.get("row1.SCHEMA")

 

variant 2 - same but with context variable. Little more complicated. You will need to create a loop for reading file row by row and store values to context variable from single row in the iteration. But variant 1 do absolutely same tasks

-----------

View solution in original post


All Replies
Forteen Stars

Re: Reading param context from an excel sheet

generally - yes

 

variant 1 - read file with Input component and connect it to tFlowToIterate

tFlowToIterate automatically store each column to the global variable.

then do all other steps as iteration. You will have a loop for each row, on each iteration you can use correspondent values with (example) (String)globalMap.get("row1.SCHEMA")

 

variant 2 - same but with context variable. Little more complicated. You will need to create a loop for reading file row by row and store values to context variable from single row in the iteration. But variant 1 do absolutely same tasks

-----------

View solution in original post

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