Dynamic File name generation

Six Stars

Dynamic File name generation

 

 

Can anyone suggest an approach to build a job which will create a file with with the name same as the source file. As I am new to this tool I am not sure from where shall I start. 

any help is highly appreciated.


Accepted Solutions
Five Stars

Re: Dynamic File name generation

Just use a tfileList (the directory where your file is present) and in the fliemask you can give depending on your file name. Connect iterate link from tfileList to tfileInputDelimited (in directory, give variable ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

In your tfileoutputDelimited component you can give value for directory as your output directory + ((String)globalMap.get("tFileList_1_CURRENT_FILE")) -----this variable stores the current filename from tFileList component.

 

I hope this helps.


All Replies
Forteen Stars

Re: Dynamic File name generation

@saurabh06101987,can you chekc below link.

https://www.youtube.com/watch?v=JFzk5s55048

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: Dynamic File name generation

Hi Manohar, 

i appreciate your effort but i guess that one is for SSIS,solution in  talend is what i am looking for . 

Forteen Stars

Re: Dynamic File name generation

@saurabh06101987,did you checked below link?

https://www.talendforge.org/forum/viewtopic.php?id=39600

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Five Stars

Re: Dynamic File name generation

Just use a tfileList (the directory where your file is present) and in the fliemask you can give depending on your file name. Connect iterate link from tfileList to tfileInputDelimited (in directory, give variable ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

In your tfileoutputDelimited component you can give value for directory as your output directory + ((String)globalMap.get("tFileList_1_CURRENT_FILE")) -----this variable stores the current filename from tFileList component.

 

I hope this helps.

Six Stars

Re: Dynamic File name generation

Hey Ravinderk,

This worked, thanks a lot for your time.

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