PDA

View Full Version : Learn VB or VBA scripting to rename large number of files.



JohnnyBravo
11-30-2010, 12:03 AM
I've been tediously renaming files in my music collection and I've got over 1,000 songs in my collection that I have been manually renaming. (I don't know how many - I just know that I had over 1,000 located in one particular folder on my internal drive. That's not counting the MP3s on my external drive). Many of the MP3 files have a number in front of the file name for example:

C:\music collection\artist1\album1\01 the winding road
C:\music collection\artist1\album1\02 you'll be fine
C:\music collection\artist1\album1\03 locks and trees
C:\music collection\artist1\album1\04 this is the time

I've been trying to do the following:
a) delete the numbers in that lead in front and
b) capitalize the words
so that the final result looks like:

C:\music collection\artist1\album1\The Winding Road
C:\music collection\artist1\album1\You'll Be Fine
C:\music collection\artist1\album1\Locks & Trees
C:\music collection\artist1\album1\This is The Time

However, I don't want to capitalize certain worlds like is, in, of. But do capitalize them if it happens to be the 1st word in the song title.

I have never taken a programming class so this is beyond my capability at the moment. The thought of hiring someone for this did cross my mind. But right now I am unemployed and looking for work, and secondly, I'm not sure I really want to pay someone for a home project that I could eventually do on my own - albeit very boring, tedious & time consuming. This is not an urgent thing.

So the question is since I've got some free time on my hands, I thought I would try to learn basic VB scripting on my own. I could buy a book or checking out a book from the library. I've never done any kind of VB scripting in my life. A little bit intimidating.

The other option is that I could search through the VBA knowledge base and threads here and learn how to accomplish atleast the 1st objective. Because I have all of the file names saved in a text file. (I simply ran the output command within the dos shell). So if I were a VBA guru, (which I am not), then I could simply work with that text that I've got & manipulate it in Word VBA so that it looks like:

ren "C:\music collection\artist1\album1\01 the winding road.mp3" "The Winding Road.mp3"
ren "C:\music collection\artist1\album1\02 you'll be fine.mp3" "You'll Be Fine.mp3"
ren "C:\music collection\artist1\album1\03 locks and trees.mp3" "Locks & Trees.mp3"
ren "C:\music collection\artist1\album1\04 this is the time.mp3" "This is The Time.mp3"

From there, I could simply copy & paste to notepad & save it as a batch file. But that gets into VBA Word which I know very little about.

Either way, I think that this project would be quite a challenge for a novice.

My question is how much time & effort would this involve? A programmer with 6 years (VB scripting) experience told me that it would take him atleast 4 hours programming & additional 4 hours debugging. Do you think he's right? Is this project really that difficult? If it is, I would probably just continue renaming the files manually because the time required to learn VB scripting and apply it to this particular project might take longer than just renaming the files manually.

Any advice here would be appreciated.

Paul_Hossler
11-30-2010, 06:08 AM
Look at a MP3 tag/file program

I really like

http://www.mp3tag.de/en/

It can change tags and filenames for folders and subfolders


I use a bulk file renamer also

http://rename.lupasfreeware.org/download.php

Paul

JohnnyBravo
11-30-2010, 11:31 PM
Look at a MP3 tag/file program

I really like

http://www.mp3tag.de/en/

It can change tags and filenames for folders and subfolders


I use a bulk file renamer also

http://rename.lupasfreeware.org/download.php

Paul

Thanks Paul - I'll take a look at those options and see what can be done.