Solved

compression

Posted on 1998-11-02
11
396 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 110 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 127
Copy a row 12 64
Add and format columns in vb6 7 63
adding "ungroup sheets" to existing vbs code 5 28
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

808 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