compression

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!
LVL 1
xer_softAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

halschCommented:
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
a111a111a111Commented:
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
kswinneyCommented:
The best tools I've found for compression in VB are Inner Media's DynaZip and EllTech's Compression Plus.

Cheers!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

xer_softAuthor Commented:
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
kswinneyCommented:
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
xer_softAuthor Commented:
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
cvidlerCommented:
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
halschCommented:
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
halschCommented:
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
xer_softAuthor Commented:
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
anzenCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.