in search of utility, perl, or other script to organize over 2,000 files quickly
December 2, 2005 3:51 PM
Subscribe
I have 2,028 zip archives and a problem that should be trivial but isn't for me. If I unzip them all with a batch utility and don't clear the path saved in the archive I end up with 2,028 directories each containing a single file. If I do clear the saved path I end up with a mess. I need either a windows utility or a perl script to do the following:
take the mess and sort it into logical directories. Call the top level directory Books. Now, in the first scenario I would end up with
Books/
./melville, herman - bartleby the scrivener (lit)/Melville, Herman - Bartleby the Scrivenr.lit
./melville, herman - moby-dick or the white whale (illust) (lit)/Melville, Herman - Moby-Dick or The White Whale (Illust).lit
etc. etc. etc.
Or, if I were to do it the second way I'd just end up with 2,028 files in a single directory. What I want is a way to loop through all those files, create a director called melville, herman and move every file that has the words melville, herman (ignoring capitalziation) at the beginning of the file name into the new directory. I'm using windows but I have a linux partition. I try to avoid mounting NTFS drives in linux but I'll do it if someone has a perl script that'll get the job done.
Thanks
posted by Grod to computers & internet (7 comments total)
posted by Grod at 3:56 PM on December 2, 2005