Dynamic excel file as input for talend job

One Star

Dynamic excel file as input for talend job

Hello,
I'm using Talend open Studio for big data, version:5.6.1
what I have to do is to give Talend an excel file everyday 2 weeks, with the same number of columns but with more data (rows), and I use the data inside of this excel sheet to feed a database.
is there a way to do this given that I will have to run the job through batch file?
thanks.
One Star

Re: Dynamic excel file as input for talend job

Yes, there is a way to pass Excel files dynamically. You will have to follow the below steps:
1. Create a Talend Job (Sample Job Name: ExcelToOracle) .
2. Pass the file name dynamically using "contexts" in the Talend tool itself.
3. Build this job and pass the jar file to Java project (Refer the link: help.talend.com/display/KB/Calling+a+Talend+Job+from+an+external+Java+application?focusedCommentId=203948387#comment-203948387).
3. Write a Java code to invoke this Talend job as follows:
public static void main(String[] args) throws Exception {
System.out.println("START");
ExcelToOracle e = new ExcelToOracle();
String [] context=new String []{"--context_param filePath="+"D:/ExcelInput.xls"};
e.runJob(context);
System.out.println("COMPLETE");
}
4. Put this Java code in a scheduler.
Regards,
   Omkar V. Kulkarni.

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

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch