home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / WORDPACK / TTOOLS.LBR / SORT.HZP / SORT.HLP
Text File  |  2000-06-30  |  3KB  |  96 lines

  1. Credits
  2. Description
  3. Options
  4. :Credits
  5.  
  6. SORT is based on the sort program from Software Tools by Kernighan & Plauger
  7.  
  8. It was converted to BDS C by Leor Zolman
  9.  
  10. It was converted to C80 with a private run time system by Michael M Rubenstein
  11. :Description
  12.  
  13. SORT will sort ASCII text files on a single key.  Only ascending order is
  14. supported.  There are, however, a large number of options controlling the
  15. makeup of the key.
  16.  
  17. To invoke SORT use the command
  18.  
  19.     sort [<options>] [<input file> [<output file]]
  20.  
  21. If output file is not specified, the output file will have the same name as
  22. the input file.  If neither input nor output file is specified, input will be
  23. from stdin and output will be to stdout, either or both of which may be
  24. redirected.
  25.  
  26. If the <output file> already exists, the old copy will be renamed with a
  27. file type of .BAK.
  28. :Options
  29.  
  30. The following options are supported:
  31.  
  32.     -c          start key after character.  character is next
  33.                 parameter.  "^" may be used to specify a control
  34.                 character.  the words "space" or "tab" may be
  35.                 used to denote those characters.  if the next
  36.                 parameter is the word "lower", the parameter
  37.                 after that will be used, converted to lower case.
  38.  
  39.     -d          number of characters (specified by -c) to look
  40.                 for.  if omitted, 1 is used.
  41.  
  42.     -e          end key at character.  same format as for -c
  43.  
  44.     -f          key consists of one or more fields.  next 
  45.                 parameter is the number of the field to start
  46.                 at (1, 2, ...)
  47.  
  48.     -i          ignore case.  case is not considered in comparisons.
  49.  
  50.     -l          key consists of one or more fields.  next
  51.                 parameter is the number of the field to end
  52.                 at (1, 2, ...)
  53.  
  54.     -n          print counts of lines in and out
  55.  
  56.     -p          position.  followed by position in line
  57.                 and length of key.  position is relative
  58.                 to 0.
  59.  
  60.     -r          sort in reverse order.
  61.  
  62.     -u          only a single line having a given key will be
  63.                 output.  if the key is not the entire record,
  64.                 there is no control over which of the lines will
  65.                 be output, making this option of little use
  66.                 unless the entire line is sorted.
  67.  
  68.     -v          verbose mode.  messages showing progress are
  69.                 displayed.  implies -n
  70.  
  71.   if -f is specifed and the end is less than the start field
  72.   or omitted, the end is taken as equal to the start.
  73.  
  74.   -e is ineffective if -f or -l is specified
  75.  
  76.   if -l is specified and the start is omitted, the start is taken
  77.   as 1.
  78.  
  79.   -f or -l may be specified with -c, in which case field 1 is
  80.   the first one after the specified character.
  81.  
  82.   -p may be specified with -c, in which case the start of
  83.   the field is relative to the the character after the
  84.   start character
  85.  
  86.   -p may be specified with -f or -l, in which case the search
  87.   for fields begins in position p.  the length is ignored
  88.   (but must be specified)
  89.  
  90.   there is no check for validity of the character at which to
  91.   start.  characters such as ^z, ^@ or ^j which cannot appear
  92.   in a line, will result in all lines being considered equal.
  93.  
  94.   if -c is specified, all lines not containing the start character
  95.   are considered equal.
  96.       verbose mode.  messa