How do I fix ALL of these file names ?

Clocker

Storage? I am Storage!
Joined
Jan 14, 2002
Messages
3,554
Location
USA
Howdy -

In the past, I used the Windows 7 built in backup utility (I think) to back up my stuff to a network drive. . Turns out, for some of my files I had to use it but the backup program created the copies of the files with wonky file names. Do any of you guys know of a way I could automatically delete all this extra timestamp info. for the files ?

See attached screen shot...

file_names_fix.JPG
 

Clocker

Storage? I am Storage!
Joined
Jan 14, 2002
Messages
3,554
Location
USA
Sterero-
The large majority are MP3 files. How do you rename from the ID3 tags? I do have Media Monkey installed if that is at all helpful.

Timwhit-
Thanks. I will look into that!
 

Stereodude

Not really a
Joined
Jan 22, 2002
Messages
10,865
Location
Michigan
Sterero-
The large majority are MP3 files. How do you rename from the ID3 tags? I do have Media Monkey installed if that is at all helpful.
I like Mp3tag myself. It has an icon for rename from tag and you put your arguments in the blank to construct a new file name from the tag.
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,297
Location
I am omnipresent
timwht's answer is really the right way to learn how to deal with munged file names.

You really do have to be careful with MP3 renaming tools because, depending on where the music came from, sometimes the tags are messed up or not present at all. Telling a top-level folder to do that for dozens or hundreds of subdirectories could exacerbate your naming problems.

Depending on your degree of anal retentiveness, going through your whole music collection with an ID3 tagging tool is kind of fun anyway. It's nice to add the correct album artwork and get your tags fixed so everything is fully searchable.
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,742
Location
Horsens, Denmark
Depending on your degree of anal retentiveness, going through your whole music collection with an ID3 tagging tool is kind of fun anyway. It's nice to add the correct album artwork and get your tags fixed so everything is fully searchable.

I managed this just for Artist, Title, and Album for 63k songs then used Mp3tag years ago. Make sure your ID3 tagging tool supports quick batching for album and artist.
 

Clocker

Storage? I am Storage!
Joined
Jan 14, 2002
Messages
3,554
Location
USA
All my songs are just in my My Music folder. There is one sub directory for comedians and one sub directory for stuff I got from my Dad. That's about it...everything else is just in the root of My Music. Mp3tag sounds easy so I will get it a shot. Not really clear to me how to even use http://regexr.com/
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
All my songs are just in my My Music folder. There is one sub directory for comedians and one sub directory for stuff I got from my Dad. That's about it...everything else is just in the root of My Music. Mp3tag sounds easy so I will get it a shot. Not really clear to me how to even use http://regexr.com/

The suggestion for regexr was to help you identify the regular expression pattern for renaming the files. From there you would need to write some kind of scripting (python, perl, bash, power shell, etc) in order to help facilitate the renaming based on the regular expression pattern that meets your needs. I would highly suggest that if the tagging doesn't work to copy a small subset of mp3's into a separate folder and try scripting in there vs. screwing up all the names in your source folder. If you want help I can try to assist with a script.
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
This is pretty close to the regex you need:

Try it out here: http://regexr.com/

I think this pattern gets all the stuff removed:
Code:
\s+\(([^\)]+)\)

I tested it on these examples below. I added a little bit to remove the space between the removed section and ".mp3" extension.

Code:
Elvis Presley - Stuck On You - 1988 (2013_11_11 01_59_35 UTC) (2013_11_15 04_48_07 UTC).mp3
Elvis Presley - She's Not You - 1988 (2013_11_11 01_59_35 UTC) (2013_11_15 04_48_07 UTC).mp3
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
If you install Python 3.5.x for windows and copy & paste this code into a text file and save it as mp3rename.py this should do the trick for you. It will loop through all file names and rename them based on the pattern you've identified. I did not make it go recursively through all folder depths. If you need that let me know.

  • Please make a backup of your files before trying this. I only did some minimal tests on my own drive and files and it worked fine.
  • Make sure to set the path to your mp3's by adjusting the variable named "path_to_mp3" to your MP3 location. Make sure to include the trailing slashes \\ at the end of the path.
  • Run the utility by opening a cmd window and typing: "d:\>python renamemp3.py"



Code:
import os
import re

path_to_mp3 = "D:\\test\\"
pattern = "\s+\(([^\)]+)\)"

if not os.path.exists(path_to_mp3):
    exit("Invalid path specified for locating mp3s.  Please enter value to 'path_to_mp3'")

for filename in os.listdir(path_to_mp3):
    new_name = re.sub(pattern, r'', filename)
    if not re.search(pattern, filename):
        print('No match found for: ', filename, ' skipping!')
    else:
        print('Original Name:', filename)
        print('New name:', new_name)
        os.rename(path_to_mp3 + filename, path_to_mp3 + new_name)
 
Last edited:

Clocker

Storage? I am Storage!
Joined
Jan 14, 2002
Messages
3,554
Location
USA
Thanks Doug. I appreciate your effort but, for all my music, Mp3tag was perfect and actually helped me give all my mp3s a uniform naming scheme.

For all the rest of my documents, image and videos, I ended up using this tool: http://www.bulkrenameutility.co.uk/Main_Intro.php with the following instructions. It was quick since all the files had the same UTC Time stamp. The tool looks like it is VERY powerful based on the number of options it provides.

Load up the "Bulk Renaming Utility and in the "Remove 5" box" tick R.
In "
Words box" enter the time code information with brackets that you can copy and paste from one of the file history files (it is the same for all of the files for that particular file history backup).
In "
Crop" enter with the drop down .. AFTER. Tick "Trim" (this will remove any gaps).
Untick Add, Auto date Numbering.

Then select (Crtl A) as many files as you can and press "Rename" or Ctrl R. You should see all your selected files back to normal with the UTC time stamp removed. Repeat this for files in all folders.
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
No problem. I was doing it for as much my own benefit as yours. :) Glad you were able to make things work with the tools you found.
 
Top