"houston" <housty@hotmail.co.ukwrote in message
news:1157471474.606199.279630@
Hi all, just wondering if anybody has any idea's on compressing data
that is somewhat predictable or in a somewhat seq order
an example:
--
as you can see most of the numbers above seem incremental to a point.
33559 -3-5-9
0222244555568 -0-2-4-5-6-8
133 -1-3
1227778899 -1-2-7-8-9
0234579 -0-2-3-4-5-7-9
0 -just zero
so we have some kind of pattern that's somewhat predictable, what
advantage could I take
of this fact with compression?
for simple to implement answers:
different options are possible, depending on what you want. for example, if
your output is ascii-text (each byte representing a number) then many
options are possible (many of which could still produce valid ascii text).
eg, exploiting simple RLE compression:
0x000x1F, 0x20: as normal
0x210x2A: 09
0x2B0x33: 0099
0x340x3D: 000999
0x3E0x47: 00009999
0x480x51: 0000099999
0x520x5B: 000000999999
0x5C0x65: 00000009999999
0x660x6F: 0000000099999999
0x700x79: 000000000999999999
or (avoiding and non-alphanumeric chars):
0x300x39 ('0''9'): 09
0x410x4A ('A''J'): 0099
0x4B0x54 ('K''T'): 000999
0x610x6A ('a''j'): 00009999
0x6B0x74 ('k''t'): 0000099999
also possible (if ascii is not needed) is using a BCD like representation (4
bits/digit):
09: 09
AF: repeat last value 27 times
or such
any takers
Graham.