Text Processing Question

Richard L. Goerwitz goer at ellis.uchicago.edu
Mon Mar 18 11:36:47 AEST 1991


In article <31134 at usc> rkumar at buddha.usc.edu (C.P. Ravikumar) writes:

>I was wondering if there is a utility to check
>for repitition of words in a document....
>
>I have the feeling this can be done using "awk".

The hard part, as always, is settling on a field separator -

BEGIN	{ FS = "['.]*[^0-9A-Za-z-']+" }
{    for (i = 1; i < NF; i++) {
         if ($i == $(i+1))
             print NR ":  " $0
     }
}

-Richard



More information about the Comp.unix.questions mailing list