Solved

Script for renaming jpg

Posted on 2014-11-06
3
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel 2013 Find and copy duplicates to a new worksheet 6 36
Outlook 2013 Contacts - comma-separated-field 20 34
any combination of this numbers 9 32
Tricky Shapes formula 3 17
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

749 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