topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 5:41 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: sort each file into separate folder  (Read 9895 times)

adrienne

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
IDEA: sort each file into separate folder
« on: March 31, 2010, 12:42 PM »
I have a need for a really dumb-sounding thing: I need to highlight a bunch of files and have each one put into a separate folder, with the folder name the same as the filename. If two files have the same name but different extensions, they should go in the same folder.

So if i start with:

apple.exe
banana.com
captain.txt
captain.exe
dog.jpg

I end up with:

apple\apple.exe
banana\banana.com
captain\captain.txt
captain\captain.exe
dog\dog.jpg

Can anyone help? Thanks in advance!

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #1 on: March 31, 2010, 06:56 PM »
I'll whip something up, as long as a Java app is ok.
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #2 on: March 31, 2010, 07:08 PM »
Not to discourage SingingBoyo, but i think a recent project by Skwire may be able to do this already:
https://www.donation....msg198450#msg198450

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #3 on: March 31, 2010, 09:47 PM »
I'd agree that skwire's project would do what is wanted, but I think that adrienne wants it to automatically create folder names etc.  Skwire's program needs you to enter all the folder names manually, which would be a hassle if you have more than 20 or so files to sort.
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #4 on: March 31, 2010, 11:42 PM »
I need to highlight a bunch of files and have each one put into a separate folder, with the folder name the same as the filename. If two files have the same name but different extensions, they should go in the same folder.

When you say "highlight a bunch of files" I will assume you are working in some sort of file manager, eh?  If so, it really wouldn't take much for me to write you a simple shell extension that will allow you to do this.  In fact, I should be able to extend my Files 2 Folder app to allow you to do this.  Let me see what can come up with.


AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #5 on: April 01, 2010, 01:27 AM »
If someone is interested i can show how to do such things with XYplorer scripting,
then you have this always with your file manager:

//Test with test files in an test folder on an second pc in an virtual machine first
"Sort files into folder according base name"
 global $criteria, $curitem;
 $action = input("Action: Copy or Move files?", "Choose from ""copyto"" and ""moveto""", "copyto");
 sel 1;
 while(1){
   $curitem = "<curitem>";
   //check if $curitem is an file:
   if (exists($curitem)==1) {
      $criteria = "<curbase>";
            //check if the folder already exist:
            if (exists("<curpath>\$criteria")==2){
                //msg "This is an file and $criteria-dir already exists.";
                sub "_$action";
            }else{
                //msg "This is an file and and we have to create $criteria-dir.";
                new $criteria, dir;
                sub "_$action";
                sel 1;
            }
   }else{
     //msg "This is an dir, we will skip this item";
   }
   sel +1;
   end (<curitem>==""), "Last item reached. Script ends.";

"_Moveto"
 global $criteria, $curitem;
 moveto "<curpath>\$criteria", $curitem;

"_Copyto"
 global $criteria, $curitem;
 backupto  "<curpath>\$criteria", $curitem, 3;


SortFiles_xys001.PNGIDEA: sort each file into separate folder

adrienne

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #6 on: April 01, 2010, 02:52 PM »
Skwire,

Yes, that's what i mean. I want to highlight them in Windows Explorer, and have them automatically sorted into folders without having to manually type filenames!

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #7 on: April 01, 2010, 03:43 PM »
Hmm, looks like I missed a rather important sentence in that he wants to highlight the files from the manager... Guess that discards my app.  Extraordinary bugs dealing with this kind of file stuff in java anyway, I must say I'm rather glad to be rid of it.
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
« Last Edit: April 01, 2010, 04:01 PM by SingingBoyo »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #8 on: April 01, 2010, 04:11 PM »
i'm sure we'll come up with some different requests for you singingboyo :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #9 on: April 02, 2010, 03:44 AM »
Yes, that's what i mean. I want to highlight them in Windows Explorer, and have them automatically sorted into folders without having to manually type filenames!

Please give the latest interim build of Files 2 Folder a try and see if it works as you envisioned.  I've tested it under XP only.  Read the help.txt file for installation and usage instructions.

Download 'Files 2 Folder' v1.0.5.3

If it passes muster, I'll promote it to v1.0.6.  Thanks.
« Last Edit: April 02, 2010, 04:24 AM by skwire »

skooter1121

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #10 on: April 04, 2010, 09:45 AM »
Try FileNanny. Developed here by ak_

FileNanny

I use it every day. Does exactly what you want.

-Wondering if there is a Gnome Nautilus equivalent, that I can run on my Ubuntu netbook?

-S

adrienne

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #11 on: April 07, 2010, 09:00 AM »
Skwire,

That worked great! Thanks SO much! Also, skooter1121, thanks for the FileNanny suggestion.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #12 on: April 07, 2010, 09:05 AM »
Great to hear.  Thanks for the feedback.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA: sort each file into separate folder
« Reply #13 on: April 07, 2010, 09:37 AM »
Files 2 Folder updated to v1.0.6 here: https://www.donation....msg201017#msg201017