Compressing a text file using count of continous characters

Chris Mellon arkanes at gmail.com
Fri Dec 14 12:07:24 EST 2007


On Dec 14, 2007 10:54 AM, nirvana <smkmenon 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.



More information about the Python-list mailing list