on 08-25-2008 8:14 PM
Hello
I am having SFTP server from which I am supposed to poll files. I have writtten a shell script to get the files from the SFTP location and had this OS level command called from XI adapter.
So the shell script first gets the file from SFTP server (since XI at present doesn't support SFTP) and then adapter will poll the same.
My problem is once i am done with my SFTP get i should be able to rename the files. But it seems rename can only rename one file at a time and can't rename multiple files at a time. i tried to use wild card characters but its of no use.
had anyone done renaming multiple files at a time on the FTP server? i was trying to use ls to get hte list of files and then loop on it but don't know how to do the same.
Thanks in advance.
Regards
Rajeev
Hi Rajeev !
Maybe an idea could be within a script, launch an ls to gather the list of filenames in a file using ">" or ">>". Then process that file using loops and parse it to detect the filenames and create a new ftp script on the fly that makes the "rename $1 $2" for each file of the previously populated list, like
http://antonolsen.com/2005/03/23/read-a-file-with-bash/
cat file.lst |while read line; do echo "rename $ $.old" >> new_ftp_script.sh; done
/tmp/file1.txt
/tmp/file with space.txt
#
then execute that script that will login again to the ftp, and send the proper rename commands.
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't rename multiple files
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
check this blog ,https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7036s [original link is broken] [original link is broken] [original link is broken]
thanks,
Hemant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.