Copying files to multiple destination folders

Seven Stars

Copying files to multiple destination folders

Hi,

I have 9 files with different names in input folder

Input:

ABC_talend_yyyy-mm-dd_00.csv

TENG_ABC_talend_yyyy-mm-dd_00.TXT

TANG_ABC_talend_yyyy-mm-dd_00.TXT

DEF_talend_yyyy-mm-dd_01.csv

TENG_DEF_talend_yyyy-mm-dd_01.TXT

TANG_DEF_talend_yyyy-mm-dd_01.TXT

GHI_talend_yyyy-mm-dd_02.csv

TENG_GHI_talend_yyyy-mm-dd_02.TXT

TANG_GHI_talend_yyyy-mm-dd_02.TXT

 I need to copy these 9 files to 9 different paths please find the below screen shot, kindly suggest a generic method to achieve this. Thanks in advance.

out.JPG


Accepted Solutions
Employee

Re: Copying files to multiple destination folders

Hi,

 

    I have created a simple flow with two destination folders but in your case you will have to build multiple if cases.

image.png

 

 

We are reading the files using tFileList and iterating one file at a time. tjava is used to orchestrate the flow and do not have any functions in it.

 

You will have to create multiple Run if statements from tjava to do file copy.image.png

 

 

Below is a sample flow with pseudo code to move your file to ABC folder. You are reading the current file and taking the substring of it and verifying whether it is ABC. Similarly you will have to do for other folders also.

 

Inside the file copy, you need to configure as shown below.

image.png

 

 

Hope I have answered your query. Could you please mark the topic as resolved if you are happy? Kudos are also welcome :-)

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

All Replies
Seven Stars

Re: Copying files to multiple destination folders

can someone please help to fix the below query

Employee

Re: Copying files to multiple destination folders

Hi,

 

     The most easy way will be to handle it through tfilelist and a series of Runif conditions in an orchestrated way. End of day, we are picking one file at a time and check whether the file name matches with corresponding folder name (or a pattern) and move them accordingly.

 

      I would suggest you to create a draft flow with sample files and if you are stuck, feel free to come back at the point of failure and we can help you there. You just have to add some screenshots of the job flow and the point of error so that we will get more details about it.

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Seven Stars

Re: Copying files to multiple destination folders

@nikhilthampi

 

could you please help with a simple flow

Employee

Re: Copying files to multiple destination folders

Hi,

 

    I have created a simple flow with two destination folders but in your case you will have to build multiple if cases.

image.png

 

 

We are reading the files using tFileList and iterating one file at a time. tjava is used to orchestrate the flow and do not have any functions in it.

 

You will have to create multiple Run if statements from tjava to do file copy.image.png

 

 

Below is a sample flow with pseudo code to move your file to ABC folder. You are reading the current file and taking the substring of it and verifying whether it is ABC. Similarly you will have to do for other folders also.

 

Inside the file copy, you need to configure as shown below.

image.png

 

 

Hope I have answered your query. Could you please mark the topic as resolved if you are happy? Kudos are also welcome :-)

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

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