It's too late for me and I may be wrong, but storing the first character and then the deltas (e.g. consecutive character differences) (got the idea from LanX's Re: Data compression by 50% + : is it possible?) achieved ~50% compression using gzip:

# a.pl use strict; #never warnings; my @inp = (); #daraset for (1..100){ my @ani = (); for (my $x=0; $x<90; $x+=10){ my @c; push(@c, int (rand(10)+$x)); push(@c, int (rand(10)+$x)); push(@c, int (rand(10)+$x)); push(@c, int (rand(10)+$x)); @c = sort{$a<=>$b}@c; for (my $i = 1; $i < @c; $i++){ push(@ani, chr(33+$c[$i])) if $c[$i] != $c[$i- +1] && $c[$i] != $c[$i-1]+1 ; } } push @inp, \@ani; } foreach my $abc (@inp){ print $abc->[0]; for(my $x=1;$x<@$abc;$x++){ print ord($abc->[$x])-ord($abc->[$x-1]); } print "\n"; }
perl a.pl > xyz ls -al xyz gzip xyz ls -al xyz.gz

In reply to Re: Data compression by 50% + : is it possible? by bliako
in thread Data compression by 50% + : is it possible? by baxy77bax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.