using ftp commands

cbest846
cbest846 used Ask the Experts™
on
How can I use the get command to retrieve a file with the latest date?  there multiple files that look like this  with a date as part of the file:   HQ_FILENAME_03312010.    
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
In my question, I forgot to add this information.  I am ftp'ing from a windows server 2008 to an ftp server.
thanks.
Commented:
Is the date format a known one, i.e. is the file always yesterdays date or todays date etc. as you basically have two methods
1. Format the filename yourself locally and the do a GET command to get it using date handling on the Windows end.
2. Take a directory listing of the remote end and get the relevant file from the list.

#1 is probably easier if it gives you the file you want.  You can get the filename right using techniqies like these:

http://www.experts-exchange.com/articles/OS/Microsoft_Operating_Systems/MS_DOS/Using-dates-in-batch-files-scripts.html

and then put that into an ftp script using these:

http://scripts.dragon-it.co.uk/links/batch-ftp-scripting

We can stitch it together if you tell us a bit moe about the file dates .

Author

Commented:
the files are sent to the ftp server by the client every day. each file has this format that contains the date it was sent --   filename example,  HQ_FILENAME_03312010.    (file ends with period) sent on 3/12/2010.   the script should run every day and pull down today's date file and copy it to same name with extension .zip.  Once in the windows directory, it would be unzipped and processed

Author

Commented:
Thank you

Commented:
I missed your response back for some reason, sorry - wasn't ignorng the Q.  Thanks for selecting my answer but if you need any more help just click on "ask a related Q" and we can carry on.

Steve

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial