The best way to copy 200+ images?

Discussion in 'Mac Programming' started by morespce54, May 22, 2009.

  1. morespce54 macrumors 65816


    Apr 30, 2004
    Around the World

    I would like to know the best way to copy 200 images from our server to my Mac... Sounds pretty easy but...

    Here is the situation:
    The images that I need are stored in different folders and sub-folders on the server. The list of images I need is in Excel. I could easily export the images names in a file (CSV or other format) but from there, what would be the best/fastest tool to copy these images over?

    thanks for you input
  2. ChrisA macrumors G4

    Jan 5, 2006
    Redondo Beach, California
    Just use the normal "ftp" command from the terminal then paste the file names into the ""mget" command from your exported CSV file. Maybe you can't paste 200 names in at once and have to use batches of 50 or 20.

    I would not bother with a script unless you will need to do this many times.
  3. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    ftp ftp://lee:xyz123@localhost/vect.cpp
    The ftp command supports an argument with a path... just make sure you're generating paths relative to the FTP root. Once you have that, we'll assume you have the paths in a file, one path per line:
    cat myfile.txt | awk '{print "ftp ftp://user:pass@server/"$1}'
    This will print the commands. You can spot check them. If they are correct, then:
    cat myfile.txt | awk '{print "ftp ftp://user:pass@server/"$1}' | sh
  4. Stratoukos macrumors member

    Jul 15, 2008
    I had to do exactly the same thing in a PC. I used excel functions to write the commands inside another cell and then coppied them in a plain text file which I execute dit as a command line script.

    I suppose you have a list of paths+files in a column. Lets suppose it's column A. Write in cell B1
    "cp "&A1&" ~/images/"&=RIGHT(A1,LEN(A1)-FIND("/",A1,3))
    and then drag down to fill the rest of the cells. Then copy all these and open a new text file. Write in the beggining "#!/bin/bash" (without the quotes) and paste under it the values you coppied from excel. Then execute it from the terminal

    This formula will take the value in the left cell, remove the first part of the path and return the rest of it.

    For example if you have "//myserver/folder/subfolder/image.jpg" the result would be: "cp "//myserver/folder/subfolder/image.jpg" ~/images/folder/subfolder/image.jpg".

Share This Page