views:

206

answers:

5

Hello I'd like to write a script that arranges my music folder to sub folders.
Is there an existing script that already does that?
How will you write your own?
What language will you choose?

+1  A: 

Well, there's an piece of software I use called Mp3tag that does just this - allows you to rearrange music files based on their ID tags. However, that's not a script...

If I were to write it myself, I'd do it in Python using one of its many ID3 modules.

Daniel Lew
Mp3tag crashes.I have a rather extensive music library.
the_drow
+1  A: 

I wrote a script in JScript to organize my photos into folders by date on import from my camera (I use Windows XP). If I were to rewrite it now for Windows, I would probably use Powershell.

If you are writing your own, understand that a common method is to use recursion to walk the file tree.

Update: continuing on in the spirit of building your own, there is a .NET C# library outlined here http://stackoverflow.com/questions/68283/view-edit-mp3-id3-data-in-c, that should make things pretty simple.

RedFilter
Keeping my answer to how to write one, as providing file management utility reommendations is out of scope for this site.
RedFilter
+1  A: 

If you can parse the meta information in the tags themselves (not sure really how to do this), you could write some sort of shell script to do it for you.

Such as: awk {' mv $1 ($1.metatag) '} or something like that.

Really, parsing the meta information will be the hardest part, since the shell tools are quite good. Write your script to parse the meta information, find all the files you want that match your criteria (such as grep on the meta information), then dynamically sort them (I'd use awk for this since you could just pipe it input from grep).

samoz
A: 

The music player I use, foobar2000, has that functionality built in. Add the music you wish to organize to a playlist, select it, and do right-click, File Operations, Move to...

You can then specify a pattern, for example

%codec%/%album%/%tracknumber% - %title%

Aistina
I dislike foobar2000.It wasn't very intuitive for me after all those years using Winamp.
the_drow
+1  A: 

http://aranger.sourceforge.net/

aranger does exactly what you want. I use it to clean up my mp3s every year or so. I tell it I want things set up by Artist/Album/Track Number - Track Title.mp3 and it takes care of the rest.

caskey