Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

compression

Posted on 1998-11-02
11
Medium Priority
?
402 Views
Last Modified: 2010-04-30
I would like to compress some single data files for use with my program. I would like my program to be able to uncompress and then recompress these files. This does not HAVE to be like .zip compression but something that will cut down on the size of the actual data file. Thanks ahead-a-time!
0
Comment
Question by:xer_soft
[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
  • 3
  • 2
  • +3
11 Comments
 

Expert Comment

by:halsch
ID: 1442989
What is a "single data file"?
Compression schemes are very data dependent.
If the data is strictly numeric, for example, each byte (digit) can be represented as a 4 bit number, thus compressing 50%. If the data is alphanumeric only, each character can be represented as 6 bits, saving 25%.  Repeating characters and spaces can be further compressed.
Also, there are utilities to compress and expand the way "setup" changes those xxx.dl_ files to xxx.dll.  
God Luck!
Hal
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1442990
I wrote a VB program that use pkzip (It free) as an external file.

If you want me to post the code here plus I will place the complete project and code on my home page so you can use it.

The program will take your file and will compress it (by 88% in my MDB file) then you can delete the original file or the compress file by overwrite it.

The program can then take the zip file and unzip it to the original with option to delete the zip file.

let me know or email to shayplace@hotmail.com

Thanks.
0
 
LVL 2

Expert Comment

by:kswinney
ID: 1442991
The best tools I've found for compression in VB are Inner Media's DynaZip and EllTech's Compression Plus.

Cheers!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:xer_soft
ID: 1442992
halsch: What I mean is that I only need to compress one file at a time not mutpial files into one single zip file.

I would like to compress only strictly numeric data. Could you please tell me or better yet show me how to do this. Thanks!
0
 
LVL 2

Expert Comment

by:kswinney
ID: 1442993
So... what you're saying is you won't pay $149 for a control that's well-tested... but you'll spend a hundred hours of your time writing or tweaking someone else's code? (that's efficient)

0
 
LVL 1

Author Comment

by:xer_soft
ID: 1442994
Umm... Sorry to be so rude but that is right. I don't have $149 to spend on a control that's well-tested. Sorry I'm not the most efficient person alive but how else will I learn. I've only been programing for about 2 years now and I have a lot to learn. Mabye you can go and buy any control you need or want but some of us people still have to do things the hard way. Sorry if I ofended you in any way. Thanks for the help you did submit.
0
 
LVL 1

Expert Comment

by:cvidler
ID: 1442995
I have written an control which uses an alogrithm similar to PKZip and it resides in an ActiveX control, It can compress streams of data, ie compress before writing to file and then decompress just after reading from the file.

It gives good compression and is pretty fast (algorithm written entirly in VB5) Post your e-mail address and I'll send you a copy so you can test it.

It is note quite as easy as giving a file name to compress but it should help a bit.

0
 

Expert Comment

by:halsch
ID: 1442996
xer_soft, If you're not happy with cvidler's proposed answer, I will show you how numeric data can be compressed by at least 50%.
In other words, the 9-digit number 861265392, for example, can be represented in 4 bytes.
 Hal
0
 

Expert Comment

by:halsch
ID: 1442997
xer_soft, If you're not happy with cvidler's proposed answer, I will show you how numeric data can be compressed by at least 50%.
In other words, the 9-digit number 861265392, for example, can be represented in 4 bytes.
 Hal
0
 
LVL 1

Author Comment

by:xer_soft
ID: 1442998
If I could look at it first I would be willing to, if I use it, give you the points. Other wise I will just use pkzip and pkunzip themselves, In which I would give the points to a111a111a111 or what ever their name is.
halsch: Your way already sounds hard. But I will also need to,eventuley, compress text. I don't now but some time in my program I found I might need to.

xer_soft@hotmail.com
0
 
LVL 4

Accepted Solution

by:
anzen earned 220 total points
ID: 1442999
There is a very good compression engine called
ZLIB which implements some APIs to compress/decompress
files, streams of data or memory buffers, the DLL interfaces
easily to VB, You can find more infos at:

http://www.winimage.com/zLibDll/

there is also a link to the official Zlib (and InfoZip) homepages so that You could (if needed) download the source
code for the libraries (and study it if You want)

0

Featured Post

Industry Leaders: 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 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