Russell: Here is a PERL script to do it. while (<>) { # for each input line @words = split; # simple split on white space foreach (@words){ $counts{$_} += 1;} } while (($w,$c) = each %counts) { print "$w: $c"."\n"; } This counts words on STDIN and sends the count to STDOUT. Use redirection to use files (perl wc.pl countfile.) Of course, YOUR definition of WORDs might not be 'WHITE SPACE DELIMITED' as this script assumes, in which case you could change the SPILT operator to a use a regular expression. This is what PERL was born to do :) At 08:28 AM 7/22/01, you wrote: >What platform? > >Jack > >Russell McMahon wrote: > > > I need a program to count the occurrence of each separate word in a > > document. > > > ...but those I can find are written for other platforms than mine. > >-- >http://www.piclist.com hint: The list server can filter out subtopics >(like ads or off topics) for you. See http://www.piclist.com/#topics Jerry Merrill jerrym@tech-tools.com http://www.tech-tools.com FAX: (972) 494-5814 VOICE:(972) 272-9392 TechTools PO Box 462101 Garland, TX 75046-2101 Join our PIC discussion list at http://www.tech-tools.com/picsource.htm -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics