Copy files with rename based on query

One Star

Copy files with rename based on query

Hello, I need to copy a bunch of files from a folder to another one and rename them during the process ; and I have a table on my database with the actual files' names and the destination names ; I stated a solution with contexte variable but lost my way ; Desperately need guidance to this, thank you
Fifteen Stars TRF
Fifteen Stars

Re: Copy files with rename based on query

Hi,

Here is the right direction:

tYourdatabaseInput --> tFlowToIterat --> tFileCopy

Hope this helps.


TRF
Highlighted
One Star

Re: Copy files with rename based on query

Dear TRF Thank you for your answer ; can you please elaborate this solution ?
Fifteen Stars TRF
Fifteen Stars

Re: Copy files with rename based on query

If you connect tFlowToIterate to your tDatabaseInput component, you'll get 1 global variable per field.

Assume you have 3 fields (currentFilename, destinationFolder and destinationFilename) and the flow after tDatabaseInput  is called "row1".

Here is the tFileCopy configuration :

Capture.PNG

 


TRF

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog