i have a big prob, lol
i have 3100+ mp3s, that are all in one folder.
i have an idea for a sorting script, but im not surehow to pull it off, so instead of me fudging with it, i thot id suggest it and see if anyone else would pick up the task
what this script would do, is scan the directory, group files with the same 7 starting letters for example, then move those files into a folder by the same name. The folders would be made dynamically as files are found...
is it possible?
MP3 Sorting Script
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
yes, it is... but im not going to write out a script for you, infact it might take several, to do the directory making..and moving the files..etc
some suggestions would be to look into
http://www.php.net/mkdir
http://www.php.net/sort
http://www.php.net/substr
and read alot about arrays.. and how arrays can be used in for and if statements and such....
some suggestions would be to look into
http://www.php.net/mkdir
http://www.php.net/sort
http://www.php.net/substr
and read alot about arrays.. and how arrays can be used in for and if statements and such....
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
Code: Select all
$root = "THE DIRECTORY";
$i = "0";
if ($handle = opendir($root)) {
while($file = readdir($handle)) {
if ($file != "." && $file != "..") {
$arrayї'$i'] = "$file";
$i = $i + 1;
}
}
closedir($handle);
}