One Star

tFTPRename problem

Hi,
I am using Talend Open Studio V4.0.3.
Through tFTPPut I can send files to an FTP server to the default root.
After the sending we have to move the files to the 'in' directory.
This last step does not happen at all.
No error is raised, but no move is done either !
I am using the tFTPRename function with wildcards (eg. *.XML).
When I use tFTPRename with exact filenames then it works OK.
Anyone who knows how to move files from one directory to another directory using FTP with wildcards (*) ?
Any help is much appreciated.
Kind Regards,
Danny
6 REPLIES
Community Manager

Re: tFTPRename problem

Hello
Using tFtpFileList to iterate each file and rename each file on tFTPRename, please see my screenshots.
New name field on tFTPRename:
"in/"+((String)globalMap.get("tFTPFileList_1_CURRENT_FILE"))

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

Re: tFTPRename problem

Dear Shong,
Thank you very much for your fast reply.
I had created the same solution but I found 2 problems :
Problem 1 :
I added "/in/" instead of "in/"

Problem 2 :
In the object tFTPFileList the 'File Detail' property was ticked. I should not do this !

Thanks again.
My problems are solved.
What a great community !
Rgds,
Danny
One Star

Re: tFTPRename problem

Hi Mr Shong,
I am performing a job with a tftpfilelist and tftprename. The purpose is to move all files in a "toto" directory to "titi" directory using tftprename component.
All my params seems to be correct:
tftpfielist:
remote directory="/toto/"

in tftprename:
filename= ((String)globalMap.get("tFTPFileList_1_CURRENT_FILE"))
new name="/toto/tata/titi/"+((String)globalMap.get("tFTPFileList_1_CURRENT_FILE"))

but when i am launching the job i have the following error:
Exception in component tFTPRename_2
com.enterprisedt.net.ftp.FTPException: Unable to determine if file "/toto/tata/titi/" exists.

I am using TIS 3.2.3.

Regards
Community Manager

Re: tFTPRename problem

Hi chesofai
It consider the directory path as file name and can't distinguish the file name, as a workaround, use tFTPGet to get all files into a local directory, and upload them into the target directory with tFTPPut.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars RSH
Four Stars

Re: tFTPRename problem

Hello Shong,
Good Morning !!!
I got struck in same problem but my scenario is bit different which is as below:
I want to get file from ftp then store those files in Local Machine and then RENAME it.
Presently i am able to get those files from tftpget component (from FTP server to Local Machine) but I AM UNABLE TO RENAME THOSE FILES.
Files are getting renamed on FTP server which i don't want , it should rename files of Local Machines.
Please guide me for same.Always thankful..
Regards
RSH
Seven Stars

Re: tFTPRename problem

There is no component to just rename a file on your local machine. You can either use tFileCopy and check "Remove source file" or use tSystem to call a system command or tJava with your own code.