Link to home
Start Free TrialLog in
Avatar of CalDev
CalDev

asked on

Move photo files based on photo names in text file

I have a list of photos that contains the names of photos that I would like to separate from a large directory of photo files. Since this would be a time consuming project to perform by hand I would like to automate the process with Coldfusion. What I want to do is put together a Coldfusion script that when run will look at the photo names in a text file and then check to see if they are present in the master photo directory. If a photo listed in the list is found in the photo directory Coldfusion would then copy each photo it finds to a new directory. Does anyone have code that could perform this task?

Here is a sampling of photo names in the text files and the photo names match exactly the photo names in the master photo directory.
Avatar of _agx_
_agx_
Flag of United States of America image

Did you accidentally omit the sampling in the original post?
Avatar of CalDev
CalDev

ASKER

Yes I did thank you for pointing it out.

_DSC0505.JPG
_MG_4015.jpg
100_2773.jpg
5589 - Train Tracks.jpg
1095965492_m.jpg
Camp 2006 108.jpg
Fly.JPG
Hodley Peak.jpg
IMG_0438.jpg
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CalDev

ASKER

Another home run! Worked perfectly and I really like the reporting feature you added, that was a big plus!
Again this one worked perfectly the very first time. I was amazed how fast I was able to process over 1400 files even on our slow local network. Thanks so much!
Avatar of CalDev

ASKER

Very useful code for verifying and separating files. It is so well written that I believe it could be easily modified to perform other file tasks.
Yes, for moderate size files it does pretty well :)
Btw, I'm sure you noticed it does a "copy" of the files, not a "move".  I think is what you wanted.  If you wanted to "move" the files instead, change the code to

<cffile action="move" ...>