Solved

Script for renaming jpg

Posted on 2014-11-06
3
319 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
Comment Utility
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
Comment Utility
> 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
Comment Utility
Wonderful program!  Thanks for the tip
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 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

8 Experts available now in Live!

Get 1:1 Help Now