Solved

Script for renaming jpg

Posted on 2014-11-06
3
325 Views
Last Modified: 2014-11-06
I need to rename about 300 student pix.  Currently, they are labeled 001.jpg, 002.jpg and so on.  I need to rename them to their individual student ID with the jpg extension.

I have an excel spreadsheet that has Column B with the 001.jpg format and Column C with the matching studentID.jpg format.

Is there a way to have the actual pictures renamed automatically without having to manually copy the student ID, go to the jpg picture and do a rename? 300 manual cut and pastes are not on my list of IT "to do's" but I seem to be the one who is left dealing with it.

By the way, I need this format to get the pictures into our SIS and another program.

Any help is appreciated.
0
Comment
Question by:smantz
3 Comments
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 50 total points
ID: 40426258
Either:

1.Create a BAT file (which is a text file which has the extension .bat instead of .txt) in that folder - or
2. open up a command window and go to that folder (easiest way - open Windows Explorer, Shift-click on a folder, and select "Open command window here").

Then copy text from the spreadsheet. What text? Text in the format:

ren "OldName.jpg" "NewName.jpg"

If you have the information in cell B2 and C2, then D2 would be:

="ren """ & B2 & """ """ & C2 & """"

Open in new window


and copy that downwards.

Verify that that looks good (and make a copy of the Windows Explorer folder before doing this - you cannot undo it).

Then either:

1. copy it into the BAT file, close the BAT file, and double-click on it, or
2. go into your Command Window, right-hand click, and paste.

In case you typed the list that you have in column B previously, then you can always use a cataloger such as the one in www.filecats.co.uk to generate that list (just in case you have additional photographs in other folders to rename - that might save you a little time later).
0
 
LVL 23

Accepted Solution

by:
Eirman earned 450 total points
ID: 40426285
> Export your excel file as a CSV file.
> Open Flash renamer and follow the instructions for renaming by using the instructions in a CSV file.
Extract From Help (Note: The rules are truncated in the above image)
Flash Renamer is a great little program and is well worth having.
0
 

Author Closing Comment

by:smantz
ID: 40426698
Wonderful program!  Thanks for the tip
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now