Solved

compression

Posted on 1998-11-02
11
387 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

758 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

16 Experts available now in Live!

Get 1:1 Help Now