-2

I have a massive file of .jpg images. I want to copy a select amount of images (400/1600) to another folder which i can send to a customer. I have a list of the image file paths I require in excel so I could do this by copying them over individually but this could take days... is there a way i can do this in command prompt or another method? This is the file path of ones of the images Y:\MMS\Data\Mobile Mapping Final Processed Data\2020-JUL-06_SH075\Track_QSphere\Track_Q-Sphere-14.jpg I would like to copy this across to Y:\MMS_SAMPLE_DATA\finalimages

any help would be very much appreciated on this please

andrew
  • 1
  • 2
  • 1
    Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 15 '21 at 15:13
  • Export/save a copy of your Excel file as CSV (comma separated values) and clivk `edit` under your question and paste 4-5 lines in. Mention if you know/have/can use Powershell, or BATCH files or `bash`. – Mark Setchell Oct 15 '21 at 15:43
  • 1
    Please review how to use SO under https://stackoverflow.com/help SO is not a free, bespoke coding service. An MRE (Minimal, Reproducible Example) of your source code is needed. Questions without code usually go to https://superuser.com/ – lit Oct 15 '21 at 21:22

1 Answers1

0

What you can do is Select the range of your file paths then run a simple macro similar to the following.

First insert a module in your workbook where you store the file paths and create this function.

Function GetFilenameFromPath(ByVal strPath As String) As String
If Right$(strPath, 1) <> "\" And Len(strPath) > 0 Then
    GetFilenameFromPath = GetFilenameFromPath(Left$(strPath, Len(strPath) - 1)) + Right$(strPath, 1)
End If
End Function

I got this function from this threaad

Next, create a extremely simple procedure similar to the following in the same module. (No Microsoft Scripting Library needed)

Sub copy_file_in_selected_range()
Dim current_range As Range, source_path As String, destination_path As String

destination_path = "C:\temp"
For Each current_range In Selection
    source_path = current_range.Value
    FileCopy source_path, (destination_path & "\" & GetFilenameFromPath(source_path))
 Next current_range
End Sub

and change the destination_path to where you want the images to copy to

Go back to your file path sheet, select the range of file paths Use Alt-F8 to bring up Marco window, select copy_file_in_selected_range and run.

Please first test in a small batch to make sure it works fine before select a large batch.

Harry Lee
  • 150
  • 9