Replace filename using spreadsheet/database

Terillius

Gawd
Joined
Feb 24, 2006
Messages
715
Okay, I think this will be simple with some kind of script, I just don't know which kind to pursue.

I have a ~200 pictures on a cd named with the students ID numbers: 10203.jpg...

I need the pictures to be named with the students name: 10203.jpg = John Doe.jpg

I can export the ID's and names to an access database or excel spreadsheet or maybe even a .csv file.

SO... What is the best way to do this? I imagine it could be done with C++, PHP, Perl, VBscript... but I am going to have to figure it out with one and I want to start with the easiest/best one.
 
If you use vbscript and its objects only, you can't actually rename the file, you have to make a copy of the file wiht the new name and delete the original.

Still easy to do with a csv file. Just read one line at a time using the text split function to spearate the old and new names and the appropriate file system object calls based on whether you want to attach to the file object itself to do the work, or just use the methods of the scripting file system object.
 
Back
Top