|
Answer» Hello ,
I am mainly a Unix person , but now I have to write a DOS program to compare filename and sizes after I download files from FTP server to check if no of bytes match and then create a FTP script on the fly to delete only the files I downloaded. This is required as new files are added every minute on to the FTP server.
Here's how far I have come
I get the LIST of files from UNIX server into a FILE say list.txt here's the contents of the file
-rwxrwxrwx 1 ksura oradev 199 Dec 19 2005 9852_pgu.ctl -rwxrwxrwx 1 ksura oradev 1773 Dec 19 2005 9852_pgu.log -rwxrwxrwx 1 ksura oradev 285 Dec 19 2005 9852_temp.ctl -rwxrwxrwx 1 ksura oradev 2124 Dec 19 2005 9852_temp.log
now I downloaded all these 4 files by creating a temporary bat file using find echo command
FOR /F "eol=; tokens=5,9 delims=, " %%a in (list.txt) do @echo get %%b >> download.ftp
now after I login and execute download.ftp , my next task is to compare the bytes of the files I downloaded with that of list.txt and if they match then I have to reconnect and delete the files from FTP server.
Please help me with the script for reading each line from list.txt and for each file name, find that file in current directory and comapre the size with that of list.txt
any help will be greatly APPRECIATED.
|