Compressing a text file using count of continous characters

nirvana smkmenon at gmail.com
Fri Dec 14 12:13:55 EST 2007


On Dec 14, 12:07 pm, "Chris Mellon" <arka... at gmail.com> wrote:
> On Dec 14, 2007 10:54 AM, nirvana <smkme... at gmail.com> wrote:
>
> > I need to count the number of continous character occurances(more than
> > 1) in a file, and replace it with a compressed version, like below
> > XYZAAAAAAAADEFAAcdAA --> XYZ8ADEF2Acd2A
>
> This sounds like homework. Google for run length encoding for
> algorithms, or check your textbook.

nah, not homework... :). And yeah got it. And thanks for its name
(RLE), that saved a lot of googles....

Thanks



More information about the Python-list mailing list