Forum Moderators: coopster

Message Too Old, No Replies

Rename file extensions

Rename file extensions

         

Fourbit

5:13 am on Mar 2, 2006 (gmt 0)

10+ Year Member



I need to rename around 500 image names out of 1000 that have the extension incorrect. Some of the extensions are .JPG and the data for the images are all lowercase .jpg.

So, I need a script that will go through all the files and rename the ones with .JPG to .jpg.

What is the best way to handle this?

Thanks

dreamcatcher

8:25 am on Mar 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Loop through the images and use the rename() function:

[uk.php.net...]

dc

Fourbit

3:06 pm on Mar 2, 2006 (gmt 0)

10+ Year Member



Thanks DC,

I'll look at that. (I think I already have) . But, it seems a bit to labor intensive. I thought there might be a quicker easier way, with a script or something.

Also, looked a bit closer and found that I need to change a lot of filenames to lowercase. Not just the Uppercase extensions as I first thought.

Paul

jatar_k

6:51 pm on Mar 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could write a script that iterates through all files and saves them as lowercase.

a little perl at the command line could also be done