Subscribe News Feed Subscribe Comments

File Renaming

This is such a nice trick, I have to share it.

I recently had the task of renaming about a thousand files. Not the easy type of rename like appending characters or changing the file extensions; each file had to be renamed something specific. It seemed like it was going to be a very tedious, time consuming task, and I was quite upset about it.

However, I did (luckily) have an Access database that contained all of the current file names along with what I needed to rename them stored in a table... I decided there had to be a better way to handle this than manually changing every file name.

After a friend headed me in the right direction, I found applications that (based on their descriptions) seemed like they would do the trick, but they would cost me $30 - $50 or more. Since I would likely only use the progam one time, I was trying to find a free or open-source application.

I never did find one, but what I did find was a tip by borntoweb in a discussion board that explained how it's possible to export the data from a database to a .csv file, alter it, rename the file extension to .bat, and voila! A file renamer tailored to your needs.

I tried it, and it worked beautifully!

Here are the steps to rename multiple files based on a .csv file:

1. If necessary, export the data from your database to a .csv file. It is also easy to copy and paste the data from the table to Excel and save the Excel to a .csv file.

2. Alter the data in the .csv file so that the first column is blank, the second column contains the current file names, and the third column has the names you want the files named to.

3. Put the word 'rename' in every cell in the first column (without any quotation marks)

4. Save the .csv file, and close it.

5. Change the extension of the file to the .bat extension.

6. Make sure the .bat file is in the same directory as the files it will be renaming.

7. You should probably make a backup copy of the files before you try this for the first time...

8. Run the .bat file. Your files are now renamed!

It may seem like this is a complicated procedure, but it's really only a three step process - export the pic data, format the data in the .csv file, and rename the extension to .bat. After the first time, it's easy.

0 comments:

Post a Comment

 
My Techie Side | TNB