Page 1 of 1
Spaces in SFTP Folder Location
Posted: Wed Mar 13, 2019 5:18 pm
by paraffin
Hi
I am working with an SFTP folder structure that has spaces which I cannot change.
I am using a variable that picks up this location on the SFTP File Loop that seems to accept the 'space' and moves onto downloading the file but I also want to delete the file on the SFTP server but the delete function interprets the space as the end of the folder string and fails.
I have tried using " and ' to encapsulate the SFTP Folder path but this stops it working altogether.
Any help appreciated
Re: Spaces in SFTP Folder Location
Posted: Wed Mar 13, 2019 7:05 pm
by paraffin
I found the solution, on the SFTP Delete I had to encapsulate the Variable in " " to allow it to work which is different how the download works.
Re: Spaces in SFTP Folder Location
Posted: Thu Mar 14, 2019 8:26 am
by Oleg
What names do you mean?
with spaces in name like this: name with space.txt
Or does file (or folder) name have leading or trailing spaces?
Provide an example please.
Re: Spaces in SFTP Folder Location
Posted: Thu Mar 14, 2019 10:50 am
by paraffin
HI Oleg
I have a task setup and with the following variables
SFTPFOLDER=/users/EI02 Export/UAT
FILESEARCH=*.*
FILETRANSFER=
LOCALFOLDER=E:\Data Import\File Import
The SFTP File Loop uses the first 2 to find files like this {SFTPFOLDER}/{FILESEARCH} it then puts the files in this local variable FILETRANSFER
In the SFTP Download, I use {FILETRANSFER} and {LOCALFOLDER} which works
In the SFTP Delete I need to use "{FILETRANSFER}" and this then works but as {FILETRANSFER} it doesn't handle the space in "/users/EI02 Export/UAT"
If you need more info then let me know
Re: Spaces in SFTP Folder Location
Posted: Thu Mar 14, 2019 1:22 pm
by Oleg
Yes, of course you have to use quotes if the name contains spaces. Otherwise the command think that you use the list of files
BTW: You can use quotes always.
Maybe we need to make some improvements in order to avoid such problem. I wrote this into our ToDo
Re: Spaces in SFTP Folder Location
Posted: Thu Mar 14, 2019 1:56 pm
by paraffin
Thanks Oleg
It could just be that the help is updated as it doesn't mention how to manage special characters