|
|
"sophia" <sophia.agnes@xxxxxxxxx> wrote in message
news:c3faab3c-8d4b-4720-bfd4-6affa6b2bd96@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Dear all,
>
> the following is the file compression program ,using elimination of
> spaces, which I saw in a book
...
Now my questions are as as follows
>
> 1) Is there any other simpler method to compress text files, similar
> to the above program(Other than standard algorithms like huffman,LZW)
Knowing nothing about compression, I had a go myself.
My first attempt looked promising, but I wasn't processing the entire file
so it was actually *doubling* the size!
Had a second attempt, and I think if done properly (tie up all loose ends)
that could achieve 20-30% (reduction that is). But it is not that simple. In
fact it's very fiddly (and requires 2 passes of the input). I guess I could
get it up to 50% if I tried hard.
What compression levels are you trying to achieve? And how simple do you
want it?
In practice I guess it would be a much better idea to use an existing
compression library, unless you like a challenge.
--
Bart
|
|