Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Help With File Renaming Based On An Excel Spreadsheet
FelipePosada
post Nov 30 2007, 08:39 PM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 1
Joined: 30-November 07
Member No.: 26,571



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.jpg

The Excel list is in the same convention except that the product name is not abbreviated.
Example: AA4G_NuptseJacket_F08.jpg

When 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.
Go to the top of the page
 
+Quote Post
vujsa
post Dec 1 2007, 03:10 AM
Post #2


Absolute Newbie
Group Icon

Group: Admin
Posts: 884
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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
Go to the top of the page
 
+Quote Post
kelvinmaki
post Dec 3 2007, 06:29 AM
Post #3


Advanced Member
Group Icon

Group: Members
Posts: 170
Joined: 30-July 07
Member No.: 23,704



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

This post has been edited by kelvinmaki: Dec 3 2007, 06:29 AM
Attached File(s)
Attached File  RenameFiles.zip ( 6.71k ) Number of downloads: 23
 
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Shut Down, Restart, Log Off XP Using A Batch File(23)
  2. How To Save A Image In Pdf File And Download It?(10)
  3. Recover Tables From A MySQL .frm File(8)
  4. Forum Based Multiplayer RPG(10)
  5. Uploading Image File Through JSP Code To Server(9)
  6. CuteNews: PHP-based Blog System - No MySQL(10)
  7. Build Your Own Adventure, New Browser Based Game(11)
  8. Running Vba Script In Excel(6)
  9. Deleting A Corrupt File(25)
  10. Need Help Urgently (missing Or Corrupt Hal.dll File).(6)
  11. Making A Turn Based Game Like Ogame(9)
  12. Web-based Ftp Client(9)
  13. Powerpoint Based Games!(18)
  14. Torn City(9)
  15. Hosting For Text Based Game...(14)
  1. Is A Php File Searchable?(8)
  2. Problem With Move_uploaded_file()(5)
  3. How To Make An Test-based Rpg Game!(4)
  4. Safari And Hosts File(8)
  5. How To Copy File & Folders From Linux To Windows?.(12)
  6. Need To Edit A Wav File [solved](1)
  7. Re-ordering Welcome Screen & Moving Heavily Fragmented File(1)
  8. Renaissance Kingdoms(0)
  9. Mysql And User File_priv(0)
  10. Mysql Database Entry By Excel Sheets(2)
  11. Anyone Willing To Make A Text-based Game With Me?(4)
  12. Browser Based Rpg(2)
  13. Xml Needed?(4)


 



- Lo-Fi Version Time is now: 21st August 2008 - 11:30 PM