View Full Version : Batch rename question: Can I do this?
Hey! I'm new here, I figured this would be a great place to ask this:
Basically, I need to rename a group of .jpg images (about 1000 or so) to fit the names of other associated files.
I have a list of the new names for the files in Excel, and I wonder if I can use Photoshop to automatically rename the current filenames in ascending order to the new names in ascending order (the number of files and the number of names in the list will be the same, and will be in corresponding positions). It is perfectly acceptable to generate them as new .jpgs rather than rename existing ones.
Can I do this at all? Rename based on a sorted database?
I am new to the batch/automate process and am using Photoshop 7.
Any help is greatly appreciated. Thanks a bunch!
bigcloud
06-10-2004, 05:22 AM
HI esq. I'm stepping out of my bounds here as I haven't relly used PS for batch processing. It sounds as though it's a job for a specialty program (or scripting ) and not PS as you haven't mentioned if these JPG's need to be altered in any way.
Are the pics in the same order (by name) as the new name list in Excel?
Hi, bigcloud
Well.. I suppose the jpegs do have to be altered (resized dimensions), but for our purposes, let's just say that step has already been completed, and now just to rename everything. (or save as new name)
If I understand your question correctly, yes you may assume the pics and the new names are in corresponding order, ie:
0001.jpg -----> 1-A1111.jpg
0002.jpg -----> 1-A1112.jpg (just an example, the names really wont be similar to eachother)
etc.. both are in order. so the first pic should be changed to the first name on the list, the 2nd to the second name, and so on.
thank you for your time!
actually, perhaps better yet, I have two lists, one with the old filename and a corresponding list with the new filename.
like:
1) 28-7123 ........ 3C017S7
2) 28-7124 ........ 3C017S9
.
.
.
hmm.. the more i look at it, the more I think this probably isn't a photoshop job, though I have been using photoshop to convert them to jpeg and resize them with batch. just need something to read the name, find the file with that name, and rename/"save as" to the next filename. Maybe photoshop can do this?
oh, woe! :)
jonbalza
06-10-2004, 08:30 AM
Ok, what is the actual naming scheme you are going to rename them to?
If it has ANY type of sequence to it, you should be able to do it, using the "Automate->Batch Rename" command that is available in the File Browser. But if it skips around like that second example, where it jumps from S7 to S9, I'm not sure it will work.
Hi, jonbalza
The names do have a certain 'scheme' to them (ie, certain digits will always be letters, and the other digits will always be numbers), but they will not always increment nicely, they will jump from time to time like my 2nd example. I suppose I was a tad unclear initially.
gonna have to find another way I guess!
thank you for the help
pixeladdict
06-10-2004, 09:14 AM
Hi...
I'm also new to this forum :]
As you said, this isn't a job for Photoshop.
If the list is as you said: (made up of two columns, one with the source filename and the other with the new one) then an easy way to do the job is making a batch file, and as you said that you are using Excel then there is a fast way to complete the job,which I'm going to explain now (sorry for being out of the forum's main subject...) :
The first part is in Excel:
Use a third column, and use one of the functions that are in Excel: there is a function called concatenate which joins any cells that contain strings together.
To use this function, just type in the formula bar (after selecting the first cell in the third column) the following text exactly as it is typed:
=CONCATENATE("move ";A1;" ";B1)
Then just drag the arrow at the bottom of the cell to copy it, and it will change the values automatically.
The last step in Excel is to select the whole column and copy it to the clipboard.
This part is in Notepad:
Open up notepad or any other word processor and just paste the content that was saved to the clipboard, then save this file as ***(anyname)***.bat and just run the file and it will do the work for you.
(just a note: check that the names are exactly accurate e.g.[c:\***\****.jpg] or just put the .bat file in the directory you want to work in and run it from there)
I hope this helps you out, and if anybody has corrections/comments on this technique please don't hesitate in replying.
And sorry again for writing something not related to design/Photoshop...
jonbalza
06-10-2004, 09:19 AM
Nice first post, PixelAddict!
I hadn't even thought about using a .bat file... Sometimes you don't see the forest for the trees! I know it's not related to Photoshop, but it definitely answers the question at hand, so I wouldn't worry about being a little off topic.
Stay around for a while, and make yourself at home!
Wow.. that just might do the trick, pixeladdict!
I'm going to try that shortly, as soon as I get a chance. That helps me out unbelievably.
I also apologize that this has gotten off-topic slightly :) I'll be sure to come up with some easy, strictly Photoshop questions soon to make up for it.. haha
thanks for everyones input too! excellent.
Well.. that worked about as good as could be expected! Thanks again!
(You can't see it, but I'm bowing down! I'm not worthy!)
Cheers, bud!
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.