Page 1 of 2

Split Folder in multiple folders for size !!!

Posted: 04 Dec 2014 13:58
by mingolito
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... :|

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

Posted: 05 Dec 2014 14:59
by foxidrive
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?

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

Posted: 05 Dec 2014 15:57
by mingolito
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

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

Posted: 05 Dec 2014 16:11
by foxidrive
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.

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

Posted: 05 Dec 2014 16:23
by mingolito
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...

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

Posted: 05 Dec 2014 21:18
by foxidrive
We'd need some info about the files, such as from a DIR listing.

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

Posted: 06 Dec 2014 03:01
by mingolito
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 ???

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

Posted: 06 Dec 2014 03:45
by foxidrive
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??

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

Posted: 06 Dec 2014 06:11
by mingolito
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: :?

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

Posted: 06 Dec 2014 15:16
by mingolito
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: 

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

Posted: 06 Dec 2014 15:45
by Aacini
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

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

Posted: 07 Dec 2014 02:32
by mingolito
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:

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

Posted: 07 Dec 2014 03:34
by foxidrive
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.

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

Posted: 07 Dec 2014 05:54
by mingolito
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:

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

Posted: 07 Dec 2014 06:12
by ShadowThief

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"