Hello ,
Please I want some help in making this small program :

the program looks for 3 or more repeated similar letters and replaces them with two characters , the first is the letter itself ( value ) , and the second character is the number of times it repeated ( count ).

Example :
AAACCMMZZZZ

Converted to :
A3\CC\MM\Z4

( less than three repeats , will be ignored, because when converted , it will contain 2 characters for the count and value , so , no difference in size for the two letter repeats )

it's a means for compressing text files ( r.l.e )
I want to know how to make a windows application that asks the user to browse for the file , and then convert it using the technique i mentioned .
OR
asks him for a compressed file and then restores it back to the original version...

ANY help is appreciated ...

Recommended Answers

All 3 Replies

post your code...

Quecoder may just need direction and not actual code help yet. Sometimes we just need guidance, not the exact answer.

Ya know like
Get the user's input put it to a string and then parse the string for the first character and then while you do that do a read ahead, if the next character is the same do a read ahead again, repeat until you reach a different character. At that point into the output string you'll want to put in the character you just checked and the count (if count <3 then put in two of the character), then from the position you left off at +1 you will check that character in the string then repeat the read ahead loop again. It is rather simple really. If you need help getting started with coding I suggest you take classes or do some reading and then when you think you're getting there but are stuck, post code and ask for help.

thank you corwing , it helped a lot ...
I need to read some and post code as you said ..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.