This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Organized without file extension [SOLVED]

Tags: None
(comma "," separated)
bobbylight
Registered Member
Posts
4
Karma
0
Hey,

I'm stupid and organized all 5000 of my songs as '%artist/%album/%track %title' when I should have done it as '%artist/%album/%track %title.mp3'.  I have removed the file extension off of all of my music.  Can someone please help me find a way to recursively add the .mp3 extension to all of my songs again.

Thanks

Last edited by bobbylight on Thu Apr 23, 2009 9:54 pm, edited 1 time in total.
metalcoat
Registered Member
Posts
47
Karma
0
Providing that amarok no longer recognises the files....Have you tried rename?
bobbylight
Registered Member
Posts
4
Karma
0
I am not familiar enough with rename to be able to use it recursively.  I saw a post on renaming .oga files to ogg with it, but I don't know how I would use it in my case.

Like I said the collection is organized as

"music collection/artist/album/track"

so if you could provide me with the command to append the .mp3 I would greatly appreciate it.
metalcoat
Registered Member
Posts
47
Karma
0
Alright, now that I think about it this probably won't work.  However, you can try this:

WARNING!!! This will rename folders too!!!

MAKE SURE YOU ARE IN YOUR MUSIC DIRECTORY

for f in */*/*; do mv $f `basename $f `.mp3; done;

You could then used amarok to organize in a different folder so that it removes the .mp3 from the folders also.

Edit: Just realized this won't work recursively.  Fixed it now so the first asterick is artist, second for album, and third for song.  This will move them all into the first directory (whereever you store your music) then you can just delete all folders.

Hope that helps.

Last edited by metalcoat on Thu Apr 23, 2009 4:56 pm, edited 1 time in total.
bobbylight
Registered Member
Posts
4
Karma
0
Thanks I'll try it in a little bit and post the results.
bobbylight
Registered Member
Posts
4
Karma
0
That worked perfectly thank you.  It actually didn't even rename my folders because the value of $f was the entire pathname to the file so it was great. 
Thank you again


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]