Need some Scripting Help

Discussion in 'Automated Trading' started by WinstonTJ, Jan 2, 2010.

  1. Can anyone help me with a small scripting problem or point me to a forum/board that would be able to help me?

    I wrote a small script in a .txt file that I execute via scheduled tasks to a .bat file. One script goes out to a FTP site and pulls files to my local directory, the other pushes my files out to various FTP sites. I have everything working properly (authentication, script, etc.) except when I say *.txt or *.csv to pull or push all .txt/.csv files only the first one is moved not all like I would assume that *.xxx would do. When I use *.* the same thing happens - only the first file as listed in the directory moves, ntot everything.

    What I have:
    As I said - this works... but I have been testing with three files in the FTP_TEST_FOLDER directory (AAA.txt, BBB.txt & CCC.txt) and only the AAA.txt file moves with "put *.txt" or "put *.*".

    Any suggestions - or referrals to other forums/boards that talk about this stuff would be much appreciated.

    Thx!
     
  2. Many on e'trader (perhaps including me) could help you, but the right forum these days is http://stackoverflow.com/
     
  3. Replace "put" with "mput."
     
  4. Thx! What about "get"? I need to get *.csv and get *.txt from FTP sites too...

    Thx again!

    EDIT: mput is not working... put works but mput does not work at all.
     
  5. dcvtss

    dcvtss

    You can use mget instead of get
     
  6. sorry, posted but after your second reply.

    Mput and Mget are not working at all. do I need to change any other syntax or just litterally put an "M" in front of the put/get?
     
  7. I am not that familiar with Microsoft's built-in ftp client, but you might try adding the command "prompt" in the file before the mput and mget to turn off user prompting. That is sometimes the problem with scripted mput or mget.
     
  8. For all interested this is what worked for me. Thx for any help!

    Inside a .txt file: (this is to pull from FTP to a local directory)

    UserID
    UserPW
    bin
    prompt
    lcd /d c:\ftp_test_folder
    mget *.txt
    bye

    Next write the following in a .txt file and a script in a .txt file, save, then change to .bat file

    ftp -s:AA_TXT_script_PULL.txt ftp.ftptestsite.com

    To PUSH files to a FTP site change MGET to MPUT and change LCD to CD and make it the directory you want to push files from.

    The .txt and .bat files must be in the same folder and must be in the same folder that the files are being pushed from or pulled to.

    Cheers!