Solved

Make Separate Zip Files of specified size limit

Posted on 2014-10-16
3
300 Views
Last Modified: 2014-10-20
User has multiple pdfs and wasnt to make separate zip archives that don't go over 10 MBs in size. But they don't want to keep making them and guessing how many pdfs to put in them.

Is there a way to use winzip to select the files and set a limit and have it make separate self-contained zip files of the specified size limit?

I found the span and split settings but it seems to make a main zip file and then accompanying files that work with that zip file.

Can they be completely separate?
0
Comment
Question by:mrmyth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
Dr. Klahn earned 500 total points
ID: 40385831
ZIP is a run-length compression method, so there's no way to tell how big the resulting file will be until the compression process is finished.  Then you look at the resulting ZIP file and say, aha, 10.4 MB.

What you want is something like the WinRAR extended archive feature, where you specify the files you want archived and WinRAR creates multiple segmented archive files under the specified limit.  (see below)  Unfortunately, WinRAR can do this only for RAR files, and it generates one segmented archive as a set of individual files, not multiple archives that fit in the size limit.

new-1.gif
If the customer is not particular about pushing the ZIP file size right up to the 10 MB limit, there is an heuristic you could try, with the knowledge that (a) it's not automatic and (b) occasionally it will fail and the resulting file will be oversize.

Take a wide sampling of the PDF files.  Compress each one individually.  Check the compression factor.  This is the worst case; compression of only one file.  Average the compression factor across all files.

Set a reasonable upper limit for ZIP file size, say 9 MB, which allows slop-over in case of bad compression.

Choose a PDF file, check the size, multiply by the compression factor.  See if this will overrun the 9 MB limit.  If not, add it to the proposed ZIP file.  Iterate until the limit overruns, then back off one file.

Create the ZIP file from the selected files.  Remove the PDF files from the available pool of PDF files.

Iterate until all PDF files have gone into a ZIP archive.

This sounds bad but is pretty quick in a Perl script.
0
 
LVL 1

Author Closing Comment

by:mrmyth
ID: 40393668
Thanks.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40393673
7zip can create volumes (i.e keep files, sort them, and attempt to fit smaller files into X sized archive, unless file is too big)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video shows how use content aware, what it’s used for, and when to use it over other tools.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question