Hi,
Just downloaded the demo and searched the forums, but the closest thing I can find was this from 2009: http://www.scriptftp.com/forum/viewtopic.php?f=7&t=175
I am wondering if it is possible to do the following:
1) On an FTP site, there is an index.txt file that has information regarding all the other files (type of document, filing date and other identifiers)
2) I want to get the file path of files that only match a certain identifiers (document type = "A")
3) Download said files
It looks like a foreach + list would work. I guess my question is there a way to automatically script $list from the index.txt (which changes every day) file?
Thanks, greatly appreciated!
Just downloaded the demo and searched the forums, but the closest thing I can find was this from 2009: http://www.scriptftp.com/forum/viewtopic.php?f=7&t=175
I am wondering if it is possible to do the following:
1) On an FTP site, there is an index.txt file that has information regarding all the other files (type of document, filing date and other identifiers)
2) I want to get the file path of files that only match a certain identifiers (document type = "A")
3) Download said files
It looks like a foreach + list would work. I guess my question is there a way to automatically script $list from the index.txt (which changes every day) file?
Thanks, greatly appreciated!
Hello,
Unfortunately I think that you need an external tool to read the txt file on the FTP site and get a list with the A type files. Then this tool should provide ScriptFTP a list with the files via, for example, a command line parameter. ScriptFTP should be called this way:
ScriptFTP.exe mydownloadscript.ftp "file1.txt|test.txt|image432.jpg"
And the script should, as you pointed, rely on the FOREACH command:
[scriptftp="mydownloadscript.ftp"]$file_list = GETPARAM(3)
FOREACH $file IN $file_list
GETFILE($file)
END FOREACH[/ScriptFTP]
Unfortunately I think that you need an external tool to read the txt file on the FTP site and get a list with the A type files. Then this tool should provide ScriptFTP a list with the files via, for example, a command line parameter. ScriptFTP should be called this way:
ScriptFTP.exe mydownloadscript.ftp "file1.txt|test.txt|image432.jpg"
And the script should, as you pointed, rely on the FOREACH command:
[scriptftp="mydownloadscript.ftp"]$file_list = GETPARAM(3)
FOREACH $file IN $file_list
GETFILE($file)
END FOREACH[/ScriptFTP]
liked Script FTP? Try our other product Email Parser