Solved

Make Separate Zip Files of specified size limit

Posted on 2014-10-16
3
292 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
3 Comments
 
LVL 23

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 61

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
CD into MP3 19 89
Making and modifying instructional videos 12 119
simple redial program 3 86
Salesforce Campaign - 4,500 members 5 49
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now