<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: How to automate sorting files into subdirectories?</title>
	<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories/</link>
	<description>Comments on Ask MetaFilter post How to automate sorting files into subdirectories?</description>
	<pubDate>Thu, 31 Jan 2008 10:58:30 -0800</pubDate>
	<lastBuildDate>Thu, 31 Jan 2008 10:58:30 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: How to automate sorting files into subdirectories?</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories</link>	
		<description>I have a large zipped MP3+G collection of about 30,000 songs split into several directories and subdirectories.  I have them named by &quot;Disc-Track - Artist - Title&quot;.

for example...

SC7501-01 - Presley, Elvis - An American Trilogy
SC7501-02 - Presley, Elvis - Devil In Disguise
SC7501-03 - Presley, Elvis - Burning Love

Although I have some that are named by &quot;Disc-Volume-Track - Artist - Title&quot;.

CB5012-01-01 - Stray Cats, The - Rock This Town
CB5012-01-02 - Looking Glass - Brandy
etc...

I&apos;m hoping to automate the following: Within a directory (and all subdirectories) Create a subdirectory for files of the same disc (or disc-volume), and move the files for that disc into that subdirectory. Repeat until every file is moved into the proper subdirectory.

I&apos;m using Windows XP.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.82455</guid>
		<pubDate>Thu, 31 Jan 2008 10:49:26 -0800</pubDate>
		<dc:creator>fanboy65</dc:creator>
		
			<category>Move</category>
		
			<category>Files</category>
		
			<category>Create</category>
		
			<category>Subdirectories</category>
		
	</item> <item>
		<title>By: syzygy</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1221325</link>	
		<description>Do you want to code this yourself? I&apos;ve been working on a script to do something similar (see http://ask.metafilter.com/81944/Help-me-get-my-images-back-online ).&lt;br&gt;
&lt;br&gt;
I&apos;m using javascript in an .hta application. ActivexObject(Scripting.FileSystemObject) will help you with the navigation of the existing directories, the creation of new ones and moving the files.&lt;br&gt;
&lt;br&gt;
If you&apos;d like to take a look at my (not 100% working) script, I&apos;d be happy to share it with you.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1221325</guid>
		<pubDate>Thu, 31 Jan 2008 10:58:30 -0800</pubDate>
		<dc:creator>syzygy</dc:creator>
	</item><item>
		<title>By: mphuie</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1221341</link>	
		<description>If you&apos;re decent at scripting, you could just split off the Disc part of the filename and move the files to a folder with the &quot;Disc&quot; name.  Create the folder if it doesnt exist.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1221341</guid>
		<pubDate>Thu, 31 Jan 2008 11:07:48 -0800</pubDate>
		<dc:creator>mphuie</dc:creator>
	</item><item>
		<title>By: Inspector.Gadget</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1221342</link>	
		<description>Well, &lt;a href=&quot;http://mp3tag.de/&quot;&gt;MP3Tag&lt;/a&gt; can do this somewhat easily.  Given a track named &quot;Disc - Volume - Track - Artist - Title&quot;, Mp3tag can use ID3 or APEv2 tags with the same information or the existing filenamer structure to re-organize a directory.  Let it run an index the whole directory, CTRL+A to select all tracks, and use Convert&amp;gt; &quot;Filename - Filename&quot; to (for instance) rename &quot;Disc 1 - Volume 1 - Track 1 - Elvis - Some Song.mp3&quot; to &quot;Disc 1\Volume 1\01 - Elvis- Some Song.mp3&quot;.  I have more experience with using ID3 tags to create filenames and subdirectories but the documentation in the forums of the MP3tag site is excellent and the developer is responsive to questions.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1221342</guid>
		<pubDate>Thu, 31 Jan 2008 11:08:00 -0800</pubDate>
		<dc:creator>Inspector.Gadget</dc:creator>
	</item><item>
		<title>By: whir</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1221557</link>	
		<description>&lt;a href=&quot;http://users.forthnet.gr/the/jtclipper/&quot;&gt;The Godfather&lt;/a&gt; also has an &quot;organize&quot; tab that&apos;s good for this kind of thing.  It&apos;s a very powerful program, but not the easiest to use.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1221557</guid>
		<pubDate>Thu, 31 Jan 2008 13:05:59 -0800</pubDate>
		<dc:creator>whir</dc:creator>
	</item><item>
		<title>By: le morte de bea arthur</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1221587</link>	
		<description>&lt;a href=&quot;http://www.softpointer.com/tr.htm&quot;&gt;Tag &amp;amp; Rename&lt;/a&gt; is also jolly excellent.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1221587</guid>
		<pubDate>Thu, 31 Jan 2008 13:20:45 -0800</pubDate>
		<dc:creator>le morte de bea arthur</dc:creator>
	</item><item>
		<title>By: mr.dan</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1222030</link>	
		<description>If you want to code this yourself, I suggest Perl (and Archive::Zip). But the fact that you asked this question suggests that you don&apos;t know Perl.&lt;br&gt;
&lt;br&gt;
Y&apos;all are suggesting MP3 organization programs. The problem is, his collection is zipped MP3+G. Good luck getting any of these programs to read it, much less handle it properly.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1222030</guid>
		<pubDate>Thu, 31 Jan 2008 17:19:35 -0800</pubDate>
		<dc:creator>mr.dan</dc:creator>
	</item><item>
		<title>By: Civil_Disobedient</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1222042</link>	
		<description>For mass batches of file changes involving commonly patterned files, I always use &lt;a href=&quot;http://renamewand.sourceforge.net/&quot;&gt;RenameWand&lt;/a&gt;.  It&apos;s simply the best, and it&apos;s free.&lt;br&gt;
&lt;br&gt;
For your example:&lt;pre&gt;java -jar RenameWand.jar &quot;&amp;lt;album&amp;gt; - &amp;lt;track&amp;gt; - &amp;lt;artist&amp;gt; - &amp;lt;song&amp;gt;&quot; &quot;&amp;lt;artist&amp;gt;/&amp;lt;album&amp;gt;/&amp;lt;track&amp;gt; - &amp;lt;song&amp;gt;&quot;&lt;/pre&gt;&lt;br&gt;
Would convert the first example you gave like this:&lt;br&gt;
&lt;br&gt;
SC7501-01 - Presley, Elvis - An American Trilogy&lt;br&gt;
to&lt;br&gt;
/ Presley, Elvis&lt;br&gt;
../ SC7501&lt;br&gt;
../../ 01 - An American Trilogy&lt;br&gt;
&lt;br&gt;
It&apos;ll even do a dry run before actually making the switch so you can see what you&apos;re going to get before doing a mass-commit.  Which is nice if you forget a space or dash or something.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1222042</guid>
		<pubDate>Thu, 31 Jan 2008 17:35:11 -0800</pubDate>
		<dc:creator>Civil_Disobedient</dc:creator>
	</item><item>
		<title>By: Civil_Disobedient</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1222047</link>	
		<description>Also, it can even convert case for you--so, let&apos;s say your files were labeled in all caps:&lt;br&gt;
&lt;br&gt;
SC7501-01 - PRESLEY, ELVIS - AN AMERICAN TRILOGY&lt;br&gt;
&lt;br&gt;
You could convert that to CamelCase, ALLCAPS, all lowercase, SOME uppercase, some lowercase, some CamelCase... it&apos;s all up to you.  It&apos;s dead-simple to use.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1222047</guid>
		<pubDate>Thu, 31 Jan 2008 17:37:53 -0800</pubDate>
		<dc:creator>Civil_Disobedient</dc:creator>
	</item><item>
		<title>By: fanboy65</title>
		<link>http://ask.metafilter.com/82455/How-to-automate-sorting-files-into-subdirectories#1222234</link>	
		<description>Thanks for everyone responding so quickly...any help is appreciated&lt;br&gt;
&lt;br&gt;
Mp3tagging software isn&apos;t what I&apos;m looking for.  If all I had was just MP3s, I&apos;m sure they would work wonderfully, but all my MP3s are zipped with the .cdg file (my hosting software plays zipped MP3+G).  All my songs are named the way they are because that is what the Karaoke hosting software requires, so there is no need to tag them...and renaming the files is not an option for me.&lt;br&gt;
&lt;br&gt;
I&apos;ve been messing around with .bat files, but my knowledge is murky at best (I feel like I&apos;ve forgotten most everything from the DOS days)...and I know next to nothing about scripting (although I have been going over some tutorials).  &lt;br&gt;
&lt;br&gt;
I have been playing with a few things I&apos;ve found, but so far nothing I&apos;ve found works 100%.&lt;br&gt;
&lt;br&gt;
I did find this batch posted on this site. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
@echo off&lt;br&gt;
setlocal&lt;br&gt;
for /f &quot;tokens=1* delims=-&quot; %%a in (&apos;dir /a:-d /b&apos;) do (&lt;br&gt;
md &quot;%%a&quot; 2&amp;gt;nul&lt;br&gt;
move &quot;%%a-%%b&quot; &quot;%%a&quot;&lt;br&gt;
)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
It seemed at first that it worked on my test files, but I noticed that it didn&apos;t move all the files into their subdirectories.  The only common denominator I could find was that the songs that all the songs that didn&apos;t move had an apostrophe somewhere in the file name.  I also couldn&apos;t figure out how to modify the batch to work with files in already existing subdirectories.&lt;br&gt;
&lt;br&gt;
I did play with it a bit and managed to change it so it would work with &quot;CB5012-01-01&quot; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
@echo off&lt;br&gt;
setlocal&lt;br&gt;
for /f &quot;tokens=1,2* delims=-&quot; %%a in (&apos;dir /a:-d /b&apos;) do (&lt;br&gt;
md &quot;%%a-%%b&quot; 2&amp;gt;nul&lt;br&gt;
move &quot;%%a-%%b-%%c&quot; &quot;%%a-%%b&quot;&lt;br&gt;
)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
...but then again, I&apos;m still not moving all the files.&lt;br&gt;
&lt;br&gt;
This is the only VBScript that I&apos;ve messed with (again, I found this here at ask.metafilter).&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Dim fso&lt;br&gt;
Dim CurrentFolder&lt;br&gt;
Dim Files&lt;br&gt;
Dim NewFolderName&lt;br&gt;
Dim TruncatedFileName&lt;br&gt;
Dim MainFolder&lt;br&gt;
Dim sh&lt;br&gt;
Dim wx&lt;br&gt;
&lt;br&gt;
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)&lt;br&gt;
Set sh = CreateObject(&quot;Shell.Application&quot;)&lt;br&gt;
Set wx = CreateObject(&quot;WScript.Shell&quot;)&lt;br&gt;
&lt;br&gt;
On Error Resume Next&lt;br&gt;
Set MainFolder = sh.BrowseForFolder(0, &quot;Select Folder&quot;, 0, 17)&lt;br&gt;
If Err then Err.Clear : WScript.Quit&lt;br&gt;
On Error Goto 0&lt;br&gt;
&lt;br&gt;
Set MainFolder = MainFolder.Self&lt;br&gt;
If Not IsObject(MainFolder) Then WScript.Quit&lt;br&gt;
If Not (LCase(Left(Trim(Typename(MainFolder)), 6))=&quot;folder&quot;) Then WScript.Quit&lt;br&gt;
&lt;br&gt;
Result = wx.Popup(&quot;Do you want to process &quot; &amp;amp; MainFolder.Path &amp;amp; &quot;???&quot;,10, &quot;Process Folder&quot;, 36)&lt;br&gt;
&lt;br&gt;
If Result = 6 Then&lt;br&gt;
ProcessFolder MainFolder&lt;br&gt;
End If&lt;br&gt;
&lt;br&gt;
Sub ProcessFolder(CurrentFolder)&lt;br&gt;
   Set Folders = CurrentFolder.SubFolders&lt;br&gt;
&lt;br&gt;
   &apos; Folders first, then files&lt;br&gt;
   For Each Folder in Folders&lt;br&gt;
ProcessFolder(Folder)&lt;br&gt;
   Next&lt;br&gt;
&lt;br&gt;
   Set Files = CurrentFolder.Files&lt;br&gt;
   For Each File in Files&lt;br&gt;
      If UCase(Right(File.Name,3)) &lt;&gt; &quot;VBS&quot; Then&lt;br&gt;
         TruncatedFileName = Left(File.Name, InstrRev(File.Name, &quot;.&quot;) - 1)&lt;br&gt;
         NewFolderName = CurrentFolder.Path &amp;amp; &quot;\&quot; &amp;amp; TruncatedFilename&lt;br&gt;
      &lt;br&gt;
       fso.CreateFolder NewFolderName&lt;br&gt;
       File.Move NewFolderName &amp;amp; &quot;\&quot;&lt;br&gt;
&lt;br&gt;
      End If&lt;br&gt;
   Next&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I like the idea that I can run this script from my desktop, but I just can&apos;t get it to work for me (I just don&apos;t have the knowledge to edit it properly).  Unfortunately I get the error &quot;Object doesn&apos;t support this property or method: &apos;CurrentFolder.SubFolders&apos;&quot;&lt;br&gt;
&lt;br&gt;
If any one would like to modify or even share your own batch or script, that would be great.&lt;/&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.82455-1222234</guid>
		<pubDate>Thu, 31 Jan 2008 20:09:55 -0800</pubDate>
		<dc:creator>fanboy65</dc:creator>
	</item>
	</channel>
</rss>
