Split Folder in multiple folders for size !!!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Split Folder in multiple folders for size !!!

#1 Post by mingolito » 04 Dec 2014 13:58

Hi guys, congratulations for the forum, sorry wrong English, i need to share a folder in multiple folders : folders 1,2,3 etc,
while keeping intact the files and subfolders within the.
I have this simple command:

Code: Select all

SOLVED


Which works great but divides the folder more 'folder with the choice of max elements... :cry: :(

Can someone give me a hand to convert the command with the choice of the size of the folders within the folders created?

Or at least the ability 'to choose the division into number of folders ??

Help me!!!! ..Thankss... :|
Last edited by mingolito on 13 Dec 2014 16:43, edited 1 time in total.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Split Folder in multiple folders for size !!!

#2 Post by foxidrive » 05 Dec 2014 14:59

Your task is not clear.

Do you want to convert a single folder full of files, to multiple folders?

How many files do you want in each folder?

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#3 Post by mingolito » 05 Dec 2014 15:57

What command is an example not good for my work!!!! :)
I have a folder containing files and subfolders, i would like to divide by the number of folders, example folder 001, folder 002, etc.
Or choose the size for each folder divided example: Folder001=10mb, Folder002=10mb,Folder3=10mb etc.
is not for the number of files as in the example :(
I don't know if I made it clear !!!
instead of using the example:

Code: Select all

set maxfiles=10

I would use something like:

Code: Select all

set maxbytesize=10Mb
OR

Code: Select all

set maxfolder=5

:D :D

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Split Folder in multiple folders for size !!!

#4 Post by foxidrive » 05 Dec 2014 16:11

We don't have enough information about the files to develop a solution.

You say 10mb as an example of a folder size for splitting files - is that exactly 10,000,000 bytes?
Will the files always be multiples of exactly 10,000,000 bytes?

We'd need some info about the files, such as from a DIR listing.

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#5 Post by mingolito » 05 Dec 2014 16:23

foxidrive wrote:You say 10mb as an example of a folder size for splitting files - is that exactly 10,000,000 bytes?
Will the files always be multiples of exactly 10,000,000 bytes?

Exactly!!! :mrgreen:
I have a folder of 180 MB, I want to divide into six parts, in six folders, each of 30 mb :|
To come out folder 001,002,003,004,005,006...Containing files and subfolders of the root folder of 180MB...

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Split Folder in multiple folders for size !!!

#6 Post by foxidrive » 05 Dec 2014 21:18

We'd need some info about the files, such as from a DIR listing.

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#7 Post by mingolito » 06 Dec 2014 03:01

foxidrive wrote:We'd need some info about the files, such as from a DIR listing.

But which ones about what files ???
You can not do automatically, as in the example that I quoted, instead of dividing the number of files selected "set maxfiles = 10" within each folder split, divide the number of folders or size of each folder uniform? ?????

You can do it or not ???
Last edited by mingolito on 13 Dec 2014 16:43, edited 1 time in total.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Split Folder in multiple folders for size !!!

#8 Post by foxidrive » 06 Dec 2014 03:45

mingolito wrote:You can do it or not ???


Tell your local builder that you want a garage on your property.

If you don't tell him if you want it in the front or the rear,
and how large to build it, and exactly where you want it built,
and what you want it built out of - if you want a roller door or not
then how will he even begin to build it??

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#9 Post by mingolito » 06 Dec 2014 06:11

foxidrive wrote:
mingolito wrote:You can do it or not ???


Tell your local builder that you want a garage on your property.

If you don't tell him if you want it in the front or the rear,
and how large to build it, and exactly where you want it built,
and what you want it built out of - if you want a roller door or not
then how will he even begin to build it??

Ok OK :!: :!: But you might as well start with a few examples from your side :wink:
I have a garage in my property "C: \ Test" on the size 5gb, i want to split the property with 5 inputs, each of 1gb, how do ??????? :wink:
Mha or am I that I do not understand, given my poor English, or you haven't figured out what I need.... :roll: :?

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#10 Post by mingolito » 06 Dec 2014 15:16

Boys while I wait some solution for my problem, if there is, I'm working on the command I posted, and someone kind enough to tell me at least, how do I set the output folder containing folders split?

Code: Select all

 :mrgreen: SOLVED :mrgreen: 
Last edited by mingolito on 13 Dec 2014 16:44, edited 1 time in total.

Aacini
Expert
Posts: 1913
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Split Folder in multiple folders for size !!!

#11 Post by Aacini » 06 Dec 2014 15:45

foxidrive wrote:
Tell your local builder that you want a garage on your property.

If you don't tell him if you want it in the front or the rear,
and how large to build it, and exactly where you want it built,
and what you want it built out of - if you want a roller door or not
then how will he even begin to build it??



at http://www.dostips.com/forum/viewtopic.php?f=3&t=6047&p=38039#p38039 foxidrive wrote:The actual details of the task are needed to write a script that will work.

If you tell your partner to go to the hardware store and buy you 3 bolts, do you think they will come home with
the 3 different sized bolts that you wanted: two brass ones in metric, and one stainless steel bolt in imperial, all in the right gauge? :D

The same thing applies in writing scripts - all the details are important.



I like these phrases! :D

Antonio

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#12 Post by mingolito » 07 Dec 2014 02:32

Aacini wrote:
foxidrive wrote:
Tell your local builder that you want a garage on your property.

If you don't tell him if you want it in the front or the rear,
and how large to build it, and exactly where you want it built,
and what you want it built out of - if you want a roller door or not
then how will he even begin to build it??



at http://www.dostips.com/forum/viewtopic.php?f=3&t=6047&p=38039#p38039 foxidrive wrote:The actual details of the task are needed to write a script that will work.

If you tell your partner to go to the hardware store and buy you 3 bolts, do you think they will come home with
the 3 different sized bolts that you wanted: two brass ones in metric, and one stainless steel bolt in imperial, all in the right gauge? :D

The same thing applies in writing scripts - all the details are important.



I like these phrases! :D

Antonio


Va Beh, funny as similitudes paraphrased, but do not bring any solution to the problem. :shock: :wink:

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Split Folder in multiple folders for size !!!

#13 Post by foxidrive » 07 Dec 2014 03:34

Aacini wrote:I like these phrases! :D

Antonio

Thanks Antonio. :)

mingolito wrote:Va Beh, funny as similitudes paraphrased, but do not bring any solution to the problem. :shock: :wink:

mingolito, It seems that you don't know how to script beyond basic commands, and it also seems that you also don't understand
the kind of information someone needs to write an effective and robust script.

Those quotes that Antonio posted are very applicable to programming too.

An important benefit of having good details of the task is that we don't waste our time writing code that has to be changed and rewritten.

mingolito
Posts: 28
Joined: 04 Dec 2014 11:34

Re: Split Folder in multiple folders for size !!!

#14 Post by mingolito » 07 Dec 2014 05:54

mingolito, It seems that you don't know how to script beyond basic commands, and it also seems that you also don't understand
the kind of information someone needs to write an effective and robust script.


:shock: Gave the example that I posted as a base, change it to solve the problem... :!:
:shock: but it takes time to understand what I need: divide a folder and its sub folders in order of size :shock: :shock:
:shock: moreover, I have not had a simple answer posted on the example of how to set the output folder ... :shock:

I do not think it needs further information to give an answer, if you know the answers you give, the similitudes let's leave to the poets.. :wink:
Last edited by mingolito on 13 Dec 2014 16:48, edited 1 time in total.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Split Folder in multiple folders for size !!!

#15 Post by ShadowThief » 07 Dec 2014 06:12

Code: Select all

set /p "outputfolder="

asks the user for the path where the split folders should be saved. If you want to have it set in the code, you can specify it like

Code: Select all

set "outputfolder=C:\Test\Output"

Post Reply