Solved

Tough Challenge: Can you automatically select only the files in a directory whose filenames appear in a spreadsheet?

Posted on 2013-12-19
8
172 Views
Last Modified: 2014-01-31
Let's say you have a column of file names in a spreadsheet (ie - 12F.jpg, 12G.jpg, 27H.jpg,  etc)

You also have a folder full of files.  Some of the files match the ones in your spreadsheet (ie - 12F.jpg, 12G.jpg, 27H.jpg).   However, some of the files in the folder do not match the ones in your spreadsheet.

Is there an way to automatically select only the jpg files that are in the spreadsheet?  That way you can make a copy of only those files for instance.

Thanks so much in advance.
0
Comment
Question by:furniturepeople
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39730169
One way to do this is to do the copy with the help of VBA.

Loop through all the files listed and copy them to the desired destination.

Use an On Error statement to ignore the copy command if the file is not present.
0
 

Author Comment

by:furniturepeople
ID: 39730184
Thanks, Is there a way to do it without VBA?  I don't know how to use VBA.
0
 
LVL 54

Accepted Solution

by:
Joe Winograd, EE MVE 2015&2016 earned 500 total points
ID: 39730202
You could highlight the whole column, copy it to the clipboard (Ctrl-C), then paste it (Ctrl-V) into a text file using whatever text editor you prefer, such as Notepad, Notepad++, Metapad, whatever. Once the file names are in a text file, you can manipulate them however you want, such as prefixing each file name with "copy" and suffixing each one with "D:\saved_files". Regards, Joe
0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 59

Expert Comment

by:LeeTutor
ID: 39771359
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 54

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 39771360
There is definitely enough information to confirm an answer. I tested the solution proposed in http:#a39730202 ā€“ it works perfectly. I used the technique to copy all of the file names in column A of a spreadsheet to a text file (.BAT) in my favorite editor. I then used a macro to automatically prefix each file name with "copy" and suffix each file name with "D:\saved_files". I then ran the batch file ā€“ worked fine. If the OP (or CV) needs more info, please let me know. Regards, Joe
0
 
LVL 54

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 39825871
Netminder,
Thank you! Regards, Joe
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are ā€¦
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final pā€¦

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question