SORT.EXE SORT.EXE is a program that can sort binary files by fields of arbitrary length. All fields are treated as unsigned values stored with their most significant byte first. Running SORT.EXE ---------------- SORT.EXE is a 32-bit program that runds under MS-DOS using the DOS Protected Mode Interface (DPMI). This allows it to circumvent the MS-DOS memory model (and thereby allocate multi-megabyte arrays when necessary), yet still call DOS functions. Under Windows 95, SORT.EXE can be run in a DOS window without further bother. Under DOS without Windows, you'll need to load an additional program called CWSDPMI. I have provided it on this disk, with its documentation. Usage ----- sort field-length input-file [output-file] [options] field-length: The size of the fields or records, in bits. inputfile: The file containing the data to be sorted. output-file: The file to which the sorted data should be written. This may be the same as the input file. If this parameter is omitted, output will be sent to stdout, and can be piped or redirected by normal means. options: One or more of the following characters, preceded by '-'. Options may appear anywhere in the command line. -f Do not load the file into memory - instead, sort it in place on disk. This will slow down the process enormously, but will be necessary if the size of a file exceeds the amount of available memory. If you choose to sort the file in place, you cannot specify an output file. -i Ignore excess bytes. Ordinarily, if the size of the file is not evenly divisible by the field length, SORT.EXE will issue an error message and halt. This option overrides this behavior. -m Sort the file in memory. This is the opposite of -f, and is the default behavior. -r Replace the input file with the sorted data. This is equivalent to specifying the same file for both the input-file and output-file parameters. Examples -------- Suppose the file "output.bin" consists of 12-byte fields. To sort it into the file "sorted.bin": sort 12 output.bin sorted.bin To sort it in place: sort 12 output.bin output.bin If it is unable to allocate the memory: sort 12 output.bin -f