Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Split a Folder You Can ???  (Read 6724 times)

0 Members and 1 Guest are viewing this topic.

Hermann

  • Guest
Split a Folder You Can ???
« on: December 12, 2014, 02:20:56 PM »
Hi!! I wanted to know if there was a chance through Batch command to split a folder and its contents in multiple folders with the choice of the number of folders to be divided.
Thanks. :)

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: Split a Folder You Can ???
« Reply #1 on: December 12, 2014, 02:33:15 PM »
Hmm, this question sounds familiar. Have you posted this question on any other forums?

Hermann

  • Guest
Re: Split a Folder You Can ???
« Reply #2 on: December 12, 2014, 03:00:58 PM »
No maybe because it's a common question !!!!!!

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: Split a Folder You Can ???
« Reply #3 on: December 12, 2014, 03:06:36 PM »
You are going to have to explain your specifications a lot more clearly. 

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Split a Folder You Can ???
« Reply #4 on: December 12, 2014, 03:22:54 PM »
Why would one split a folder?
This sort of thing is more often done with a library manager. For each file in the collection, another file is created that contains short summary of more information about the item. The information data is used to then sort the files into relevant directories. The trick is how to crate the informational files. In some cases a search on the Internet provides the information needed.
Examples: Movie titles, Song tiles, Books, Famous people, Baseball cards.

Hermann

  • Guest
Re: Split a Folder You Can ???
« Reply #5 on: December 12, 2014, 03:41:21 PM »
I have not found no information on the internet I am only interested split a folder and its contents into multiple parts.
If anyone knows how to do it I'd thank so much.

Salmon Trout

  • Guest
Re: Split a Folder You Can ???
« Reply #6 on: December 12, 2014, 05:08:30 PM »
What do you want to do exactly? Explain fully in clear, good English. Or else go away.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Split a Folder You Can ???
« Reply #7 on: December 12, 2014, 05:14:26 PM »
When one wants to arrange things is a meaningful order, it is a part of database management. Or you can call it what you want.
Below  is a simple batch file that can do part of that.
It uses the DOS MOVE command.
http://www.computerhope.com/movehlp.htm
Quote
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

[drive:][path]filename1    Specifies the location and name of the file or files you want to move.

destination    Specifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also include a filename if you want to rename the file when you move it
You would make a new directory inside the current one.
MD Af   would make a directory names Af.
Code: [Select]
MD Af
MOVE A*.* Af
MD Bf
MOVE B*.* Bf
You could repeat this for the letters of the alphabet and up to 26 new directories.
Is that what you want?

Hermann

  • Guest
Re: Split a Folder You Can ???
« Reply #8 on: December 13, 2014, 04:51:31 AM »
The issue is that the professor asked to choose in how many parts to split the folder, leaving intact the order of the files and subfolders within them.
This is the pseudocode to complete. Somebody can help me to solve it?

Code: [Select]
input(source)
input(out_folder)
input(size_folder)

files = file_list(source)
out = 0
cur_dir = out_folder + out
cur_size = 0
for (file in files) {
  if (cur_size > size_folder) {
    out = out + 1
    cur_dir = out_folder + out
    cur_size = 0
  }
  if not exists(out) {
    mkdir(out)
  }
  cur_size = cur_size + size(file)
  copy(file, out)
}

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: Split a Folder You Can ???
« Reply #9 on: December 13, 2014, 08:27:52 AM »
The issue is that the professor asked to choose in how many parts to split the folder,
Nobody really likes doing other people's homework for them.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: Split a Folder You Can ???
« Reply #10 on: December 13, 2014, 10:22:24 AM »
unfortunately (or maybe fortunately) we do not do homework for other people.  I would recommend setting up a meeting with your professor if you don't understand what they went over in class, they will be able to explain better what they want than we will.
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

Hermann

  • Guest
Re: Split a Folder You Can ???
« Reply #11 on: December 13, 2014, 10:34:10 AM »
I'm sure that you are able. it's Christmas and we are all better. O:)
You are my hope! :'( :'( :'(

Salmon Trout

  • Guest
Re: Split a Folder You Can ???
« Reply #12 on: December 13, 2014, 11:18:31 AM »
Hermann, you wrote "solve" before, well, we solve puzzles, this is not a puzzle, it is an exercise intended to 1. Tell your professor how much you have understood of the class you have taken 2. Give you practice in creating code. If we do your homework we would be preventing both of these from happening. You have not shown any evidence that you have tried to produce anything.

Hermann

  • Guest
Re: Split a Folder You Can ???
« Reply #13 on: December 13, 2014, 01:23:16 PM »
Hermann, you wrote "solve" before, well, we solve puzzles, this is not a puzzle, it is an exercise intended to 1. Tell your professor how much you have understood of the class you have taken 2. Give you practice in creating code. If we do your homework we would be preventing both of these from happening. You have not shown any evidence that you have tried to produce anything.

The code I posted is only an example to understand.

I don't understand this excuse that you have taken, as the professor does not receive, does not help and does not repeat the lesson.

If I posted in a forum of programming support, I think it will serve to give aid and support of all kinds and in any case the code will also serve other users of the forum.

I have no help, I have only your support, so if I can not solve and operate the program I will not be able to continue my studies, for this reason examine your conscience and
tell me if you can help me definitely.

Salmon Trout

  • Guest
Re: Split a Folder You Can ???
« Reply #14 on: December 13, 2014, 01:44:16 PM »
Rolls eyes

Allan

  • Moderator

  • Mastermind
  • Thanked: 1260
  • Experience: Guru
  • OS: Windows 10
Re: Split a Folder You Can ???
« Reply #15 on: December 13, 2014, 01:53:29 PM »
I'm not comfortable with either helping with homework or belittling the OP. I'm locking the thread. It's okay to not want to help, but if that's the case please just ignore (or report) the thread. Thank you.
« Last Edit: December 13, 2014, 02:19:38 PM by Allan »