Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!psuvax1!psuvm!blekul11!ffaac09 From: FFAAC09@cc1.kuleuven.ac.be (Nicole Delbecque & Paul Bijnens) Newsgroups: comp.editors Subject: Re: repeated character editing Message-ID: <91088.115805FFAAC09@cc1.kuleuven.ac.be> Date: 29 Mar 91 11:57:05 GMT References: <1991Mar28.181335.7813@cbnewsm.att.com> Distribution: usa Organization: K.U.Leuven - Academic Computing Center Lines: 21 In article <1991Mar28.181335.7813@cbnewsm.att.com>, cadman@cbnewsm.att.com (jerome.schwartz) says: >How would I do a simple edit command, vi map or sed script, to >replace all occurrences of repeated characters in a file with one >of each of the characters. > >ie: This: AAAAPPPPLLLLEEEE ppppiiiieeee > to this: APPLE pie try (on SYSV) tr -s '[\001-\377]' '[\001-\377]' < input > output giving: APLE pie ^ | one letter P! This program does not know to spell the words! -- Polleke (Paul Bijnens) Linguistics dept., K. University Leuven, Belgium FFAAC09@cc1.kuleuven.ac.be