d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help Changing Mass Amounts Of Music Titles
12Next
Add Reply New Topic New Poll
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 09:45am
Have over 10,000+ songs,

Alot of songs are titled...

Pitbull feat. LL Cool J-Walk With Me (Karaoke)

And I need a program to change the "-" to " - " with a space before and after the hyphen.

Also need any song with the word "feat." to be changed to "ft.".

Also, if possible, any time a file has the word "(Karaoke)" i would like a " - " placed in between the last word before the "(Karaoke)" and the actual "(Karaoke)" itself.


End result would be....

Pitbull ft. LL Cool J - Walk with Me - (Karaoke)





In summary I Need ...
Pitbull feat. LL Cool J-Walk With Me (Karaoke)

Changed Into...

Pitbull ft. LL Cool J - Walk with Me - (Karaoke)


And of course I need the program to process large folders of 1,000+ song titles.




Some songs already have a " - " (space hyphen space) correct, so any " - " (space hyphen space) already named correctly it needs to bypass editing that section of title.


Let me know JSP


Thanks,


-Kurt


Can pay forum coins. I have some programming experience so a rough fille processing program shell would do just fine

This post was edited by Littlekurt39 on Dec 26 2013 09:46am
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 10:05am
How do I search for a file with "-" and exclude files with " - " (space hyphen space) just using windows explorer file search?
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 10:49am
Windows 7 btw
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Dec 26 2013 01:45pm
depends on what language you are using, a quick and dirty example in python

Code
#python 2.7
import os

def ChangeName(input_filename, input_root, input_dirs):
new_filename = input_filename
if " - " in new_filename:
pass
else:
new_filename=new_filename.replace("-", " - ")
new_filename=new_filename.replace("feat.", "ft.")
if " - (Karaoke)" in new_filename:
pass
else:
new_filename=new_filename.replace("(Karaoke)", " - (Karaoke)")
new_filename=" ".join(new_filename.split())
new_filename=new_filename.strip()
input_file_full_path = input_root + "\\" + "\\".join(input_dirs) + input_filename
new_file_full_path = input_root + "\\" + "\\".join(input_dirs) + new_filename
if input_file_full_path != new_file_full_path:
try:
os.rename(input_file_full_path, new_file_full_path)
except:
print "failed to rename " + input_file_full_path


music_folder = r"c:\music"
for root, dirs, files in os.walk(music_folder):
for file in files:
ChangeName(file, root, dirs)
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Dec 26 2013 02:11pm
couldn't you write a pretty simple powershell script or something to do this (if you only wanted to use stuff already on your machine)

This post was edited by Eep on Dec 26 2013 02:17pm
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 02:50pm
Been out of programming for 4 years or so. Also files are on a buddy's computer so not sure if he has any compiler etc etc.

how difficult/long of a process is it to get a python compiler? And any recommendations on a python compiler?
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
Dec 26 2013 02:55pm
Quote (Littlekurt39 @ 26 Dec 2013 22:50)
Been out of programming for 4 years or so.  Also files are on a buddy's computer so not sure if he has any compiler etc etc.

how difficult/long of a process is it to get a python compiler?  And any recommendations on a python compiler?


it takes 2 minutes to get python up and running
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 02:59pm
Yeh Im looking at a tutorial seems pretty simple install. Should be able to work with this Code supplied.

I got windows 7 64-bit btw,


http://www.python.org/getit/



any recommendation on which link is suited for my OS?

This post was edited by Littlekurt39 on Dec 26 2013 03:02pm
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
Dec 26 2013 03:11pm
Quote (Littlekurt39 @ 26 Dec 2013 23:02)
Yeh Im looking at a tutorial seems pretty simple install. Should be able to work with this Code supplied.

I got windows 7 64-bit btw,


http://www.python.org/getit/



any recommendation on which link is suited for my OS?


Yes, you obviously want to get Python 2.7.6 Mac OS X 32-bit i386/PPC Installer (for Mac OS X 10.3 and later [2])

Please avoid Python 3.3.3 Windows X86-64 MSI Installer (Windows AMD64 / Intel 64 / X86-64 binary [1] -- does not include source) like the plague itself, it's obviously not for your OS as you can see.

By the way, it's common courtesy to NOT private message others a copy of your message. It shows that you are an impatient person who deserves less help than you've already shown to deserve.

This post was edited by Eagl3s1ght on Dec 26 2013 03:12pm
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 03:48pm
If it was my computer I would be able to make certain decisions much easier. However this is not my computer and the owner is very cautious and visually wants to see the recommended process as he has an extreme collection of DJ files in which i recommended can easily be handled with limited manual work. For what its worth your outline of code is very helpful

:)

This post was edited by Littlekurt39 on Dec 26 2013 04:11pm
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll