Compressing a text file using count of continous characters

2007-12-14 Thread nirvana
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
XYZDEFAAcdAA --> XYZ8ADEF2Acd2A

Thanks
Sumod
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compressing a text file using count of continous characters

2007-12-14 Thread nirvana
On Dec 14, 12:07 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On Dec 14, 2007 10:54 AM, nirvana <[EMAIL PROTECTED]> 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
> > XYZDEFAAcdAA --> 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
-- 
http://mail.python.org/mailman/listinfo/python-list