[resolved] How to pass the Path of a tab delimited file that is to be uploaded?

One Star

[resolved] How to pass the Path of a tab delimited file that is to be uploaded?

Hi,

I am trying to create a job where the user gets to choose the file to be uploaded to the table. I have made a java code which gets the path of the File the user selects, after that i have called the job with the path of the file as argument parameter. I am stuck after that, i don't know how to assign the path name to the tFileInputDelimited so that the job works. Also is there a way where i can allow the user to choose the mapping?
Note: the table and the db are fixed.

Any help will be appreciated.

Thanks
Aviral
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

I am looking for same type of help in my project.Can you please tell me how you did the first part.
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

create a context variable and assign that context variable to your tFileInputDelimited.,

select the PROMPT (FILE) option, it will popup a box to select a file.
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

Hi Ashu,

Thanks for your reply, it works now, but the problem is that it gives a popup in which i have to specify the file path, can i get something like a file chooser which opens a file dialog box which allows the user to browse through directories and select a file.
Secondly, what i wanted to know, is it possible to pass the value of the file name from the java code in which i am using the job. i am using netbeans for my java project and mysql as db.

Thanks
Aviral
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

You cannot choose the file..instead create a variable in context saying file path and file name and jus give ur file path(eg:c:/ann) and ur filename.it ll automatically go the particular path and reads ur file
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

Hi,

You can pass the value of the context variable while calling the job with arguments as --context_param <context variable name>=<value>
--context_param INSTANCE_ID=1


Thanks & Regards,
Vijay.M
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

Hi Vijay,

what i am doing is that i have a java application, i have created a jar of the job and and included in the project, is it possible for me to select the file path in my java application and then when i call the job i can send the file path as an argument of the main function, and then set it as context variable?

Thanks
Aviral
One Star

Re: [resolved] How to pass the Path of a tab delimited file that is to be uploaded?

Hi Vijay,

Thanks a lot, it is working now, i am using file chooser in my java project to get the path of the file and then sending the path and instance_id as arguments.

Thanks again
Aviral

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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads