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.