FTP from Widows to UNIX system - how to? ( was To not to duplicate)

Dear team , thanks for your support. I am trying to not to duplicate a thread if one is already there for what I am looking, which I am not able to figure out. Is it OK if I post the post the following question in new thread.
---

" I am having little trouble to create a script to get file from UNIX box to Windows through ftp. Right now I amusing the following script to pick specific file.

 FTP open <remote server>
'login'
'pwd'
cd 'files path in remote server '
get 'DAILYFEED_20151202_163216.txt'

How to pick the latest one if there are many files with the similar name and time stamp is different in file name.

Ex: List available is

'DAILYFEED_20151202_163236.txt
'DAILYFEED_20151202_163436.txt
'DAILYFEED_20151202_193226.txt
'DAILYFEED_20151202_193211.txt
'DAILYFEED_20151202_193216.txt
'DAILYFEED_20151202_183216.txt
'DAILYFEED_20151202_173216.txt
'DAILYFEED_20151202_163222.txt
'DAILYFEED_20151202_163220.txt
'DAILYFEED_20151202_163219.txt
'DAILYFEED_20151202_163218.txt
'DAILYFEED_20151202_163217.txt
'DAILYFEED_20151202_163216.txt

I need to pick and pull

'DAILYFEED_20151202_193226.txt

Kindly help me with the solutin. Thanks in advance.

Sai

i would do it in 2 passes. first connect and issue an ls -l command. save the output to a file, then examine the file and decide which file(s) you want and re-connect to retrieve.d

jgt, what I understand is write 2 scripts one for selecting the latest file name and the other for moving the file. Is it correct.

can you please help me with the sample script, if possible.

I'm a little confused. Your title of this thread says FTP from Windows to Unix but in your post#1 you say

"I am having little trouble to create a script to get file from UNIX box to Windows through ftp."

So which direction are we going in?
Is the script going to run on the Unix side or the Windows side?
Is FTP going to "put" or "get"?

Please clarify.

Either way;

ftp host >filelist
user
password
cd 'filepath'
ls
quit

You should now have a list of all the files on the source system, in the local file filelist.
You should now examine filelist to decide which file(s) you want to move and write them to a new file looking something like

cd pathtofile
get DAILYFEED_20160121.txt
quit

then re-connect

ftp host <new_file

If you are running the ftp client on the unix system, then you can create a .netrc file in the home directory of the user running these scripts so that you do not need to enter the user and password.
Sample script to select files:

count=0
echo "cd pathtofiles"
while read filename
do
    if [ $filename = "some criteria" ]
    then
     echo get (or maybe put) $filename
     count=`expr $count + 1`
     fi
done <filelist
echo "quit"
if [ $count -eq 0 ]
   then
   exit 1 
   #no files selected
else
    exit 0
fi