home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
UTILS2
/
SORTX100.ZIP
/
SORTX.DOC
next >
Wrap
Text File
|
1994-03-11
|
5KB
|
104 lines
3/10/94 SORTX 1.0
=========
by Warren S. Macchi
macchi@cs.ucf.edu
SORTX is an enhancement to the sort program distributed
with DOS operating systems. It has the same functions as
the normal sort, plus some additional capabilities.
This document has two sections. The first part introduces
the operation of the DOS sort program in a simple and short
manner. The second part details the characteristics of the
SORTX program, which is an enhancement of the DOS version.
If you are familiar with the operations of the DOS sort
version, you may want to skip part one.
PART 1:
------
The sort distributed with DOS (2.0 and up) is a simple
to use sorting program that reads ASCII character lines
from the standard input, sorts the lines in increasing or
decreasing order, and outputs the sorted lines to the
standard output. The lines are sorted without regard to
upper or lower case letters. In addition, lines can be
sorted beginning at a particular column specified in the
command line.
The following explanations assume that you have a path
to the DOS files directory, or that you are in the directory
that contains these files.
A sample use of the DOS sort program is:
sort /+8 <unsorted.doc >sorted.doc
where the input is taken from the "unsorted.doc" file, the output
goes to the file "sorted.doc", and the sorting is accomplished
starting at column 8 (specified by the /+8 switch). A reverse
sort can easily be done by including the /r switch.
As you can see, sorting of text lines is an easy task. Some
uses of this program are encountered while programming in
high level languages like BASIC, C, or PASCAL. The program
invokes a shell to the DOS operating system with the name of
the file to be sorted in place of "unsorted.doc," and the output
filename in place of "sorted.doc." Typical users of the sort
program are addresses, dictionaries, and other databases.
You can see how sort works by just typing "sort"+ENTER. The
program is now waiting for input from standard in, which is the
keyboard. Just type in some lines with names or other data, then
press the F6 function key (or CTRL-Z) plus ENTER, and the
input is displayed in sorted order. That easy!!
PART 2:
------
The DOS version of sort has some rather limited capabilities.
Input data is restricted to no more than 64K, and line lengths are
restricted to about 130 characters. This means that a database with
data above these limits will not be accepted by the DOS sort. In
addition, a file with many lines may take a long time to sort.
SORTX 1.0 comes to the rescue by increasing the number of lines
accepted to 15000, line lengths of up to 2000 characters, a fast
sorting algorithm, and less memory requirements for small files.
Input data is only restricted by available conventional memory and
the line lengths and number of lines limits specified above.
SORTX has the same command line structure as the regular
sort version, plus some more. The following is a list of them:
/h or /? displays a list of available switches and current
configuration
/r produces a reverse sorting order
/p gives input data statistics after processing
/- inhibits display of sorted data
/+nn sorts data starting at column "nn"
The /p and /- options are useful when only an idea of the size
and characteristics of the input file is needed. It is also useful
for giving an idea of the time required to process a particular file,
without displaying it. You can rename SORTX.EXE to SORT.EXE, so that
programs that look for SORT.EXE can use the advanced capabilities of
SORTX.
Running on a 286-16Mhz machine, SORTX can sort 15000 lines of data
in about 22 seconds! This is achieved by the use of a fast split
and merge algorithm. If you are interested in getting a copy of the
source file (for C++), you can ask me to e-mail it, or mail it to you,
at the e-mail address below.
Hopefully you will appreciate the improvements that SORTX gives
to the sorting of data. If this is the case, or if you have ideas
for new features that you would like it to have, you can contact me
at the e-mail address listed at the top of this file.
SORTX is freely distributable, but please include all the files
with it (SORTX.EXE and SORTX.DOC).
Thank you for using SORTX!!