[prog] bulk re-naming of files

Wolf Rising wolfrising at gmail.com
Wed Jan 26 10:41:20 EST 2005


Hi, I was wondering if anyone might be able to help out with a script,
maybe either php or perl to run from the command
line? I have a bunch of photographs that are stored in a database, if
you run a mysql select it returns the
p_code ( person code), s_code (subject code) and file name. I need to
rename all the photos which are just named with
numbers (0005.JPG) to be the person's name John_Smith.JPG. Here's an
example from the database:

+-----------+---------------------------+-----------------------------+
| p_code    | s_name                    | filename                    |
+-----------+---------------------------+-----------------------------+
| 000797079 | Betty M. Brum         00005.JPG          |
| 000803314 | Mary E. Rems         00047.JPG          |

there are well over 650 photos I need to rename.  My other option at
the moment is to download the directory
with all the photos and rename them one by one :-) Any help, ideas,
suggestions, would be greatly appreciated :-)

Thank you!


More information about the Programming mailing list