home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / txtutl / wc.lbr / WC.DQC / WC.DOC
Encoding:
Text File  |  1985-06-13  |  1.4 KB  |  25 lines

  1.                   Documentation file (23 lines) for
  2.                       WC (Word Counter program)
  3.                     David Coons (CIS [72435,136])
  4.                             February, 1984
  5. ----------------------------------------------------------------------
  6.      My wife writes short stories, and was in need of a way to get an
  7. approximate word count of a WordStar file.   To my delight, in K&R
  8. ("The C Programming Language", BW Kernighan and DM Ritchie, Englewood
  9. Cliffs, NJ:  Prentice-Hall, 1978, page 18) I found a simple word count
  10. algorithm, which I converted to 8080 assembler code.  It's not fancy,
  11. but it works.  It does need one feature to work better with WordStar
  12. files, however:  ignore all lines beginning with a "." (e.g., .MT 6).
  13.  
  14.      WC counts words in any text file, and displays the count on the
  15. console in the form, "File contains 00000 words".  A word is defined
  16. as any character sequence surrounded by 'white space' (i.e., spaces,
  17. tabs, carriage returns, or line feeds.  (WC will ignore the high
  18. order bit in all file characters.)  To run WC, simply type:
  19.           WC filename.ext
  20. WC cannot process wildcard filenames (e.g., WC B:*.TXT is illegal).
  21.  
  22.      As far as performance goes, a 3200-word file took approximately
  23. seven seconds, including the one or two seconds CP/M took to load the
  24. WC program.
  25.