Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi,
I have created a simple flow with two destination folders but in your case you will have to build multiple if cases.
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.
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.
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
can someone please help to fix the below query
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
Hi,
I have created a simple flow with two destination folders but in your case you will have to build multiple if cases.
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.
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.
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