zsh-users
 help / color / mirror / code / Atom feed
* Splitting up files into equal sized groups O/T
@ 2007-05-12 12:25 zzapper
  2007-05-14 15:00 ` Peter Stephenson
  2007-05-15 18:55 ` Thor Andreassen
  0 siblings, 2 replies; 5+ messages in thread
From: zzapper @ 2007-05-12 12:25 UTC (permalink / raw)
  To: zsh-users

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)

Ideas?

-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Splitting up files into equal sized groups O/T
  2007-05-12 12:25 Splitting up files into equal sized groups O/T zzapper
@ 2007-05-14 15:00 ` Peter Stephenson
  2007-05-15 18:55 ` Thor Andreassen
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2007-05-14 15:00 UTC (permalink / raw)
  To: zsh-users

zzapper <david@tvis.co.uk> wrote:
> 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)

The neatest way would be to tar (or, failing that, shar) the files up and
split that.  The overhead isn't that great.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Splitting up files into equal sized groups O/T
  2007-05-12 12:25 Splitting up files into equal sized groups O/T zzapper
  2007-05-14 15:00 ` Peter Stephenson
@ 2007-05-15 18:55 ` Thor Andreassen
  2007-05-16  8:52   ` zzapper
  1 sibling, 1 reply; 5+ messages in thread
From: Thor Andreassen @ 2007-05-15 18:55 UTC (permalink / raw)
  To: zsh-users

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

-- 
regards
Thor Andreassen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Splitting up files into equal sized groups O/T
  2007-05-15 18:55 ` Thor Andreassen
@ 2007-05-16  8:52   ` zzapper
  0 siblings, 0 replies; 5+ messages in thread
From: zzapper @ 2007-05-16  8:52 UTC (permalink / raw)
  To: zsh-users

Thor Andreassen <ta@imada.sdu.dk> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Splitting up files into equal sized groups O/T
@ 2007-05-15  0:23 Wingot
  0 siblings, 0 replies; 5+ messages in thread
From: Wingot @ 2007-05-15  0:23 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Re: Splitting up files into equal sized groups O/T.eml --]
[-- Type: message/rfc822, Size: 2791 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 706 bytes --]

Peter Stephenson wrote:
> zzapper <david@tvis.co.uk> wrote:
>   
>> 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)
>>     
>
> The neatest way would be to tar (or, failing that, shar) the files up and
> split that.  The overhead isn't that great.
>
>   
Beyond this you would need some sort of a script, including 
conditionals, to solve the problem as you have described it (roughly 
equal sized, independent archives).

[-- Attachment #2.1.2: Type: text/html, Size: 1211 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-05-16  8:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-12 12:25 Splitting up files into equal sized groups O/T zzapper
2007-05-14 15:00 ` Peter Stephenson
2007-05-15 18:55 ` Thor Andreassen
2007-05-16  8:52   ` zzapper
2007-05-15  0:23 Wingot

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).