Solved

compression

Posted on 1998-11-02
11
391 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

773 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