Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Splitting up files into equal sized groups O/T



Thor Andreassen <ta@xxxxxxxxxxxx> wrote in news:20070515185545.GA25344
@imada.sdu.dk:

> On Sat, May 12, 2007 at 12:25:08PM +0000, zzapper wrote:
>> Hi
> 
> Hi.
> 
>> I want to zip up 50 or so very large files into 4 huge zip files.
>> 
>> The problem is that the files themselves are all very different sizes,
>> I want to find a way of splitting up the list of files into four lists
>> so that the size of the resulting zips are roughly the same size.
>> 
>> (I don't want to use split zips)
> 
> Do you mean you want to put 50 files of different sizes into 4 new files
> of the same size? and doing this without splitting any of the 50 files?
> 
>> Ideas?
> 
> If the above is true then I think you are trying to solve the knapsack
> problem, and should probably resolve to to some of the solutions
> suggested here [1].
> 
> [1] http://en.wikipedia.org/wiki/Knapsack_problem
> 
Knapsack problem is a good analogy and has given me an idea. That is that a 
few really big files distort the problem, a solution therefore is to zip up 
all the files less than a certain size, leaving a manageable list of larger 
files.


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Messages sorted by: Reverse Date, Date, Thread, Author