GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Make folders out of filenames? (https://gfy.com/showthread.php?t=432505)

nickjcuk 02-16-2005 05:15 AM

Make folders out of filenames?
 
Im looking for some software that can do this.

Basically i have a big folder full of movies that I want putting in folders (with the same name as the file)

Doing this manually is a headache... Is there any software out there that would save me this time?

Many Thanks!

nibbi 02-16-2005 05:56 AM

I have a tool that will do what you are looking for. I have to take the kids to school, but will upload it someplace for you to get it when I get back.

broke 02-16-2005 06:07 AM

On *nix boxes with php you could run the following code from a php file in the folder assuming the folder permissions are set correctly.

This code is based on all the file names having three letter extentions and just lops four characters off the end of the filenames to create the folders. It also does not delete the files from the directory from which they are copied.



PHP Code:


<?php

// On *nix boxes this is the full directory path  

$directory "/complete/path/to/directory/";

if (
is_dir($directory)) {

   if (
$contents opendir($directory)) {

       while ((
$file readdir($contents)) !hahahaha false) {

           if(
is_file($file)) {

        
mkdirsubstr($directory $file0, -4) , 0755 );
        
copy$directory $file substr($directory $file0, -4) . "/" $file);

       }

       }

       
closedir($contents);
   }
}

?>

The hahaha should actually be two equals signs.

nibbi 02-16-2005 06:21 AM

Here you go:

http://www.nibbi.net/scripts/downloads/filesort1.2.zip

Pretty straight forward to use. Drag and drop a directory onto the app window, select the min number of chars to match, select min number of files that should be in a group (in your case 1) and then press OK. It will process all files within the directory you selected and will create a folder for each 'group' of files and move them into the folder.

Once the process is done, you will be shown a list of all folders that were created. You can drag and drop folders into each other in this list to combine two or more folders.

Play with it and see if it will suite your needs. You might want to try working with a small number of files first, as you can't undo the move.

nickjcuk 02-16-2005 06:33 AM

Thanks for the help.

That software worked ok, but the file matching options kept mucking everything up :(

Looks like im gonna have to carry on by hand

Thanks anyway

broke 02-16-2005 06:34 AM

Are you working on a windows box?

nickjcuk 02-16-2005 06:53 AM

windows, yup


All times are GMT -7. The time now is 11:17 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123