FTP scripting on Windows 2000

  • Thread starter Thread starter nsajus
  • Start date Start date
N

nsajus

Hi,

Is there a way to concatenate date to a string in the .scp script
file?. I
want to get the following string in the .scp file


"\\server2\TestDir\Test_CH\Archive\CH"&Date&".txt"


It should result in a string like


"\\server2\TestDir\Test_CH\Archive\CH12102005.txt"


with the date in mmddyyyy format. Is it possible to set it like this in

a .scp file?

I would like to do this because I want to email the latest file from an
Archive directory to a remote server. And the files in the Archive
folder have the date appended to it.

So basically I would like put statement generated dynamically in the
..scp file everyday with the date like below:


PUT "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" "CH.DAT"

where "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" is on local
machine

and

"CH.DAT" will be name of the file on the remote machine


Any help will be very much appreciated!


Ann
 
I would like to do this because I want to email the latest file from an
Archive directory to a remote server. And the ..

Sorry..what i meant to say was ftp the latest file..

Thanks,
Ann
 
Hi,

Is there a way to concatenate date to a string in the .scp script
file?. I
want to get the following string in the .scp file


"\\server2\TestDir\Test_CH\Archive\CH"&Date&".txt"


It should result in a string like


"\\server2\TestDir\Test_CH\Archive\CH12102005.txt"


with the date in mmddyyyy format. Is it possible to set it like this in

a .scp file?

I would like to do this because I want to email the latest file from an
Archive directory to a remote server. And the files in the Archive
folder have the date appended to it.

So basically I would like put statement generated dynamically in the
.scp file everyday with the date like below:


PUT "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" "CH.DAT"

where "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" is on local
machine

and

"CH.DAT" will be name of the file on the remote machine


Any help will be very much appreciated!


Ann

Here is how to get the string
"\\server2\TestDir\Test_CH\Archive\CHmmddyyyy.txt"
into a text file:

echo>test.scp
\\server2\TestDir\Test_CH\Archive\CH%date:~4,2%%date:~7,2%%date:~10,4%

(this is one single long line!)

Depending on your date format zone, you may have
to adjust the numbers 4,2, 7,2, 10,4 to suit your
requirements.
 
Back
Top