Solved

Make Separate Zip Files of specified size limit

Posted on 2014-10-16
3
301 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 28

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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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