write a program that accept a txtfile and compress it by removing adjacent duplicate characters. for example if the txtfile contains the line: DID THE BUNNY GET THE MISSISSIPI MAPS FROM BBB then the corresponding output must be: DID THE BUNNY GET THE MISSISSIPI MAPS FROM B..

your example is wrong. What about the two Ns in Bunny and the s's in Mississippi?

DID THE BUNY GET THE MISISIPI MAPS FROM B

One problem with that is there is no way to recreate the original sentence. In any event, you will have to show is what you have attempted, such as post some code or pseudo code.