Jump to content
xisto Community
Sign in to follow this  
FelipePosada

Help With File Renaming Based On An Excel Spreadsheet

Recommended Posts

Hey everyone, my problem is I have a folder full of images that I need to rename to match a list of names I have in an excel spreadsheet. There are roughly 1200 images and I was wondering if there was any way to automate this process.The files are in the following convention, a four character prefix, underscore, a product name, underscore, "F08.jpg"Example: AA4G_NuptseJkt_F08.jpgThe Excel list is in the same convention except that the product name is not abbreviated. Example: AA4G_NuptseJacket_F08.jpgWhen loading the images to be displayed on our website the software won't recognize the images unless the image names match with the names on the list. Can anyone suggest anything to automatically rename the images based on the four character prefix from the list?Also, I think it should be mentioned that the prefixes are all different.

Share this post


Link to post
Share on other sites

I may be able to write a script in PHP that will do the job for you but I would need a little data.Perhaps a list of 10 filenames and their corresponding spreadsheet match. I could then run a few tests to see how to best write the script.It would probably start by building an array for each then bridge them so that item 1 in array1 was the match in array2 etc...Then just rename file with name in array1 with the name from the same in array2.I'll await your reply.vujsa

Share this post


Link to post
Share on other sites

Or instead of using PHP to code, you can try using the Microsoft Excel Macro Editor to create a small program to do the file renaming for you. There's this website that I've found it quite useful, at least it gives you the basic idea. http://www.mrexcel.com/archive/VBA/4832.html.

The idea is by reading all the image files from that folder and moving the file object to what is stated in the excel spreadsheet.

1. create another folder to store all renamed images.
2. have a loop reading all the images from the current folder.
3. then read the stated name from the list of worksheet given.
4. moving the current selected images to the stated name to the new folder (created at step 1).

I've also found some information and sample code for renaming files in Excel in the internet. You can reference to it if you want. But of course if all these are pretty troublesome, then maybe you can wait for vujsa program. Hope some of it help you started. Cheers

Edited by kelvinmaki (see edit history)

Share this post


Link to post
Share on other sites
excel changing my input of dateHelp With File Renaming Based On An Excel Spreadsheet

how do I prevent excel to change the format of my date

example I typed 12-11-2008 but it is automatically converted to 12/11/2008

I tried adding a single quote before the date ex. '12-11-2008

its seems working then I have to save my work as a .Csv file

when I'm trying to open it again in excel its showing 12/11/2008 

I tried to verify the file using notepad and still it is showing exactly what iwant something like 12-11-2008,ABC,100

seems like excel is changing the display of my date

please help thanks

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.