[resolved] How to store File path in context variable

One Star

[resolved] How to store File path in context variable

Hi,
I am new to Talend, Please can any one tell me how to store file path of tFileInputExcel in context variable.
Thanks in advance.

Accepted Solutions
Community Manager

Re: [resolved] How to store File path in context variable

Hi
Define a context variable and assign a default file path to it, set the File name/stream field of tfileInputExcel in context variable like:
context.filePath

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] How to store File path in context variable

Hi
Define a context variable and assign a default file path to it, set the File name/stream field of tfileInputExcel in context variable like:
context.filePath

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to store File path in context variable

Hi
Thanks, but i need to store the file path of input file in context variable, so that i can use it later.
Suppose i browsed one file from D drive, and then after doing some operation i want to create another file in same location with name like FileName_temp.
One Star

Re: [resolved] How to store File path in context variable

Hi
Actually my input file changes frequently, so i can't define in context variable as you said.
Thanks
Community Manager

Re: [resolved] How to store File path in context variable

if the file name might change, you can use tFileList component to iterate all the files that matches the file mark you define. Take a look at the component manual:
https://help.talend.com/search/all?query=tFileList&content-lang=en

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business