d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help Changing Mass Amounts Of Music Titles
Add Reply New Topic New Poll
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 09:54am
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
Member
Posts: 12,237
Joined: Dec 7 2006
Gold: 1,230.56
Dec 26 2013 10:49am
How do I search for a file with "-" and exclude files with " - " (space hyphen space) just using windows explorer file search? Windows 7 btw
Member
Posts: 9,803
Joined: Jun 28 2005
Gold: 6.67
Dec 26 2013 10:49pm
are these all mp3 files?
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Dec 27 2013 12:48am
Member
Posts: 3,143
Joined: Apr 2 2009
Gold: 175.00
Jan 5 2014 04:05pm
you can do this by using something called tinydir.h... What you'd need to do is create a string of what you want to find, and what you want to change it to (string find, replace; find = " feat"; replace = " ft."), then parse the dir with tinydir in a loop, throw the filename into a temp string, search the string for find and if found replace with replace ( if(temp.find(find) != string::npos = false){//code to determine what the position and length is, followed by code to replace that text with replace}, after doing that, you just copy the file, and write it with the new name via iostream, and then delete the old file.

This post was edited by Roger911 on Jan 5 2014 04:07pm
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Jan 16 2014 06:36pm
1) install linux
2) install vim
3) vim script.sh
4) :r !lsq1y$oESCpj0q10000@1ggq1Jjq10000@1ggq1imv ESC (make sure you use the number of files instead of the 10000, you can get it by looking at the linenumbers of the script.sh right after the ":r !ls")
5) :%s/feat/ft/gc (or whatever replacement you want. make sure you only change second parameter of the mv commands)
6) repeat 5) for all replacements
7) :w!sh script.sh:q
6) profit
Member
Posts: 142
Joined: Dec 21 2013
Gold: 23.00
Jan 17 2014 11:11pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll