Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Labels (3)
6 Replies
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
0683p000009MC05.png
alevy
Specialist
Specialist

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.