home *** CD-ROM | disk | FTP | other *** search
-
- WC.DOC - Documentation for WordCount version 1.23 28/10/1991
-
- Documentation and executable code Copyright (c) 1991 Michael E. Ralphson
-
-
- Disclaimer:
- ===========
-
- The Author retains copyright in that he alone has the right to make copies for
- profit. In all other respects users may treat this software as if it were in
- the Public Domain, as long as the package is distributed whole and unmodified.
-
- In my opinion this software is perfectly safe and is free of any serious bugs,
- however I have to make it clear that use of this software constitutes the
- user's full acknowledgement that the author takes no responsibility WHATSOEVER
- for the consequences of such use.
-
- Commercial users must register within 30 days if they wish to continue using
- this software. For non-commercial users registration is purely voluntary.
-
- See the enclosed REGISTER.DOC for more information.
-
-
- Introduction:
- =============
-
- WordCount is an ASCII-text word, line and page counting program for
- word-processors and text editors that do not provide these features as
- standard. It is useful on the DOS command-line as well as being called from a
- macro in your word-processor.
-
- The above was the original plan for WordCount, and things have changed a bit
- since then...
-
- WordCount is intended to be small, fast, flexible and easy to use.
-
-
- Usage:
- ======
-
- WC <param> [<param>...]
-
- Where <param> is a text file, a list of filenames to count or an option.
-
- Note: WC with no parameters produces a summary of these instructions.
-
-
- Word-processor Macros:
- ======================
-
- A word-processor macro should run along the following lines: save the current
- document in non-document (ASCII) mode, then shell to DOS issuing the command:
-
- WC.EXE <current_filename>
-
- If your WP does not provide for the transmission of the current filename to
- external programs in this manner, you should set up a batch file as below and
- use it to run your WP:
-
- Echo Off
- Echo %1>WC.TMP
- WP %1
- If Exist WC.TMP Del WC.TMP>Nul
-
- Your macro should now consist of saving the current file, followed by a call to
- DOS with the command:
-
- WC.EXE @WC.TMP
-
-
- Text files:
- ===========
-
- WC assumes DOS standards such as lines terminated with carriage returns and
- line feeds (used in line and page counting, not word counting), though it does
- not require an end of file marker. WC can also handle WordStar (tm) files, see
- below.
-
-
- List files:
- ===========
-
- A list file is a file containing a list of text files to be processed by WC,
- one file-specification per line. On the WC command-line the name of a list must
- be preceded by an 'at symbol' (@) character.
-
- Due to a (useful) quirk in Turbo Pascal (tm), using @ on its own as a list file
- name causes WC to get the list of file names to process from the keyboard. Type
- a CTRL-Z character to end keyboard input if you use this feature.
-
- Files taken from a list are shown indented one space on the screen. Failure to
- find a file (list or text) will not halt the program, it will continue until
- the command-line is exhausted.
-
- List files may not contain more lists. A word-counting program shouldn't need
- recursion!
-
- Lists are useful when the same set of files must be counted several times and
- their filenames cannot be expressed simply as sets of wild cards.
-
-
- Wild cards:
- ===========
-
- Both filenames given on the command-line and those in lists may include
- wildcards (* and ?). Extended wildcard specifications such as C:\*.T* which
- confuse certain versions of DOS, may be used.
-
- Note: Wildcards may not be used in list file names, eg: @*.LST
-
-
- Options:
- ========
-
- Most WC options follow the usual standard of /<letter><+|->
-
- /<letter>+ turns the option ON, /<letter>- turns it OFF, /<letter> toggles it
-
- The N option, which controls whether WC counts strings of numbers as words,
- defaults to ON.
-
- The W option, which controls WordStar (tm) compatability, defaults to OFF.
-
- The S option, which controls whether WC splits lines that are longer than the
- line limit (initially 80 characters, see /L), defaults to ON.
-
- The D option, which controls whether WC displays each word as it is counted,
- defaults to OFF (this was originally a debugging feature)
-
- The F option, which controls whether WC calculates a Fog-Index (averge word
- length indicator) for each file, defaults to OFF.
-
- The next three options, which define WC's page length and line width are
- slightly different:
-
- /Pnn sets the page length to nn lines. It defaults to 66, and /P on its own
- will reset this value.
-
- /Lnn sets the line width to nn characters. It defaults to 80, and /L on its
- own will reset this value.
-
- /Rn.n sets the word rate to n.n pounds for writers who are paid by the word.
- For example, /R0.01 would be 1p per word. The default is 0.0 (not calculated).
-
- Options can be used anywhere on the command-line (but not in lists!), so as to
- bracket one or more files:
-
- WC *.txt /w *.WS /w /n /l120 *.acc
-
- All .TXT files are processed according to the defaults
-
- All .WS files are processed as WordStar files
-
- All .ACC files are processed as having a line length of 120 characters, and
- numbers are not counted as words
-
-
- General bits:
- =============
-
- If more than one file was successfully read, a table of totals and averages is
- displayed. Writers who are paid by the word will be glad to know WC rounds up.
-
- Output from WC is fully redirectable.
-
- WC requires a fair chunk of memory (the length of the file or 64k, whichever is
- smaller), but can handle any size of file.
-
-
- Version history:
- ================
-
- 1.00 Original non-release version, personal use only
-
- 1.01 As above
-
- 1.02 Bug fix, tidying. Released as part of WC-ETC utilities
-
- 1.10 Improved handling of larger files
-
- 1.20 Wild cards, list files etc
-
- 1.21 Fine tuning of count routines, more options
-
- 1.23 Line count works with TextUtil compression, word rate
-