GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Batch rename photos from a text file? (https://gfy.com/showthread.php?t=942389)

TheDA 12-08-2009 08:37 AM

Batch rename photos from a text file?
 
Is there a prog or app that can do this.

I have a folder of say 400 pics with default file names DSCF0001.jpg - DSCF0400.jpg.

I need to rename them and don't want to do each one individually so wondered if a prog was the best way to go. I figured it was quicker cutting and pasting the new file names into one text file or excel document and have the prog or app do it. Ideally, if I can pull in the datestamp from the exif data into the filename also then great.

Associated file names are sporadic and don't really follow a sequence.

DSCF0001.jpg - boat1.jpg

DSCF0002.jpg - house1.jpg

DSCF0003.jpg - car1.jpg

DSCF0004.jpg - house3.jpg

DSCF0005.jpg - hotel1.jpg

DSCF0006.jpg - boat2.jpg

Babaganoosh 12-08-2009 08:45 AM

This can be easily done in any scripting language. PHP would be easiest.

http://www.php.net/manual/en/functio...-read-data.php

Wolfy 12-08-2009 08:49 AM

are they on your windows machine?

If so, select all, right click, rename - windows will rename them all [yourname]1.jpg [yourname]2.jpg etc.

TheDA 12-08-2009 09:16 AM

Quote:

Originally Posted by Babaganoosh (Post 16626151)
This can be easily done in any scripting language. PHP would be easiest.

http://www.php.net/manual/en/functio...-read-data.php

Thanks but beyond my abilities :)

TheDA 12-08-2009 09:17 AM

Quote:

Originally Posted by Wolfy (Post 16626166)
are they on your windows machine?

If so, select all, right click, rename - windows will rename them all [yourname]1.jpg [yourname]2.jpg etc.

Yes, on a Windows machine, but the yourname portion is different for each one. Thanks.

CPimp 12-08-2009 09:26 AM

ACDSee might be able to do that for you

ReGGs 12-08-2009 11:54 AM

separate them by the titles you want that then you can use a free program like xnview. Then all you have to do is rename them like this house# and it will number them accordingly.

TheDA 12-08-2009 12:01 PM

Quote:

Originally Posted by ReGGs (Post 16626691)
separate them by the titles you want that then you can use a free program like xnview. Then all you have to do is rename them like this house# and it will number them accordingly.

Thanks. I see a batch rename feature on that but does it let me pull in the names from a text file?

It is that part that I essentially need.

Twistys Tim 12-08-2009 12:41 PM

On my Mac I use a program called File List -- drag the list in, tell it what you want, and press rename.

james_clickmemedia 12-08-2009 01:14 PM

there are lots of programs out their for windows. I am on the mac so use Name Mangler which works great.

NemesisEnforcer 12-08-2009 01:56 PM

Quote:

Originally Posted by tube2k (Post 16626270)
ACDSee might be able to do that for you

ACDSee will do that for you. :thumbsup

SmokeyTheBear 12-08-2009 02:56 PM

php.. heres what you want to do

make a new folder on your server called temp, upload all images to temp, upload the list of new names in a file called newlist.txt filenames should be on a new line
example
name1.jpg
name2.jpg
name3.jpg

save this is index.php
Code:

<?php

// open list
$list = file_get_contents("newlist.txt");
// split list into array
$listarray = explode("\n",$list);
// where to start list from , 0 = top
$count = "0";
// do something for each jpg in the folder starting with the first one
foreach (glob("*.jpg") as $filename) {
//rename the image to the corresponding name in the newlist.txt
rename($filename, "$listarray[$count]");
// show browser its done
echo "Renamed $filename -to- $listarray[$count]\n<br>";
$count = $count + 1;


}
?>

upload to the folder temp
chmod folder 777
run the index in your browser

TheDA 12-08-2009 03:28 PM

Thanks all. Looks like Smokey's is the best option for me. Thanks Smokey.

TGThomas 12-08-2009 04:42 PM

af5 its free its easy and has lots of different items for you to use


All times are GMT -7. The time now is 06:38 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123