program DEDUPE { © www.merlyn.demon.co.uk >= 2003-01-17 FILTER; just pipe a sorted list through DEDUPE any parameter suppresses summary } ; var Snew, Sold : string ; Wrote, Dupes : longint ; procedure OUT ; begin if Dupes>0 then begin Writeln(Dupes:6, ' ', Sold) ; Inc(Wrote) ; Dupes := 0 end ; Sold := Snew ; end {OUT} ; BEGIN Sold := '' ; Wrote := 0 ; Dupes := 0 ; while not EoF do begin Readln(Snew) ; if Snew<>Sold then OUT ; Inc(Dupes) ; end ; OUT ; if ParamCount=0 then Writeln(Wrote, ' lines out') ; END.