home *** CD-ROM | disk | FTP | other *** search
- SORT by J. W. Rider
-
- The SORT program is copyrighted by the author. A general license
- is granted to execute the SORT program for any personal or
- business use. A restricted license is granted to distribute
- either the user's version or the developer's version of SORT.
- These restrictions are:
-
- 1) only ordinary copying and/or connect time fees can be charged
- for distribution of the SORT program and files,
-
- 2) copyright notices must remain intact in the distribution of
- the SORT source code,
-
- 3) my copyright notice must be embedded in modified executables.
- If any other copyright notice is displayed, my copyright notice
- must also be displayed.
-
-
- In short, you are free to do with this program whatever you want
- as long as you don't try to pass it off as your own -- or as
- public domain -- and as long as you don't make any money off
- of it that would ordinarily be subject to royalty payments.
-
-
- Files included in the developer's version of SORT:
-
- ANSTR.FUN -- included function for stripping
- non-alphanumeric characters
-
- BTSORT.INC -- included procedures for manipulating the
- binary tree
-
- BVAL.FUN -- included function for forcing a numeric value
- from a string.
-
- ERREXIT.INC -- included error exit procedure
-
- FINDFLD.FUN -- included function to find variable length
- fields in a line of text
-
- HEAPMEM.FUN -- included heap management functions
-
- ISATTY.FUN -- included function to determine source of
- standard input
-
- ISWILD.FUN -- included function to determine ambiguity in
- file specifications
-
- LCASE.FUN -- included function to convert a string to all
- lower case characters
-
- REV.PAS -- short program to reverse the ordering of text
- lines
-
- SORT.MAN -- description of SORT syntax and usage
-
- SORT.PAS -- SORT program main
-
- SORT.TYP -- included type declarations
-
- SORT.VAR -- included global variable declarations and
- initializations
-
- SORTARGS.INC -- included procedure to parse option switches on
- command line
-
- SORTHLP.FUN -- included function to display help message
-
- STDINHDR.INC -- included procedure to prompt user for input
-
- WORDS.PAS -- short program to generate a listing of "words"
- from standard input
-
-
- The user's version contains the following information in lieu of
- manual pages for REV and WORDS:
-
- REV -- reads from standard output, writes to standard input.
- Completely reverses all lines read: "abcde" becomes "edcba".
-
- WORDS -- generates a list of "words", one word per line, from
- standard input, to standard output.
-
- Let's say, hypothetically, that what you wanted to do was to get
- a list of all words in a file (FILE1) sorted by the last letter
- in the word (reverse dictionary order). Put the results in file
- SUFFIX.
-
- C> words <file1 | rev | sort -c -u | rev >suffix
-
- The "-c" option for SORT causes differences between upper and
- lower case to be ignored. The "-u" option suppresses multiple
- instances for identical words.
-
- If all you wanted to do is to generate a listing of unique words
- without regard to case (for running through a spell-checker for
- instance), try this:
-
- C> words <file1 | sort -c -u -k | sort -u | >wordlist
-
- The "-k" option causes SORT to write each word out as it was used
- for sorting -- in this case, in lowercase. The second stage
- removes duplicate keys.
-
-
- J. W. Rider
- [72426,1640]