================================================================ Dufford's Fast-Fix for the DiskCat Slow-Sort ================================================================ Such a nifty program like DiskCat deserves a faster sort. Here it is! Main Features: 1. SPEED: This program sorts the output file of the DiskCat program in a few seconds (compared with a LOT of minutes for larger catalogs). 2. VERSATILITY: The sort may be on any combination of the fields: filename,diskname,directory,date,icon(y/n),extension. 3. ASCII OUTPUT: The sorted output file may be an ascii disk file which in turn may be scanned with MORE, or edited via EDIT (or TEXTCRAFT) or dumped to print. The default output simply overlays the original file with the new sorted order, so that DiskCat may still read it. To Use: After having created and saved a Disk Catalog using DiskCat, click on the similar icon with the word "sort" added to it. The program needs two things: 1. the name of the catalog file created by DiskCat (specified in the upper box of CatSort) 2. the fields you want to sort on (in the order you want) specified by clicking on the button gadgets with the appro- priate field names OPTIONALLY, you may also request that the output file be in simple text format (ASCII), specified in the lower of the two string input boxes at the top. Notes: "Catalog Name" is the name given to DiskCat when the requester for SAVE CATALOG appeared. Those of you that use CLI will notice that the catalog has actually be stored in two disk files, on with a ".cat" extension and one with a ".dsk" extension. CatSort works only with the ".cat" file, and will automatically add the extension ".cat" when it opens this file. (Example: if under the DiskCat program you gave the name OurLib to the catalog file, then you would type in OurLib in the "Catalog Name" box under CatSort.) "Ascii FileOutput" is the name of the optional output file. It will be placed in the same directory as Catalog File un- less a full pathname is given. (cf. Version 1.4 notes below) "Available" sort fields are those fields maintained by DiskCat upon which CatSort orders its data. There are many more possibilities here that the few in DiskCat though DiskCat has the most useful. The order of the sort fields (seen in the Active Field list) determines the sorting order for the output file. From 1 to 6 fields may be used. When you click on the Sort button, the Sorting begins. The program creates a new window to report its progress so that you won't get bored. It signal the end with that memorable line from Porky Pig, "That's all, folks." Any error messages are reported at the bottom. The rest you should get with intuition. By the way,... 1. The sort ignores the case of the various fields. 2. The sort takes place in core and requires about 88 bytes for each entry (84 for the data, and 4 for the pointer). The memory required will vary with the size of the CatFile. 3. You will find that most of the time is spent in reading and the files from disk. It takes about 9-12 seconds to sort 1700 filedata items on 2-3 fields 4. The date sorting is first on year, then month, then day. Enjoy... Bob Dufford, S.J. Creighton University Omaha, NE 68178 (402) 280-2779 Version 1.4 Addition --- Database format output The ASCII Output filename may contain additions to set up the output for transfer to a format readable by a database program. The filename may be followed by "-d" plus two optional delimiters (field and records). The examples should explain most quickly: filename -->regular output for viewing on the screen or printing on paper, fields padded with blanks for nice columnar appearance filename d -->fields ended by a default delimiter, the vertical bar ("|"); records ended by a default carriage return filename db @ -->fields ended by the specified delimiter '@'; re- ended by the default carriage return filename dink # $-->fields ended by the specified delimiter '#'; re- cords ended by the specified delimiter '$'. filename dumb | '-->fields ended by the vertical bar ('|') and re- cords ended by the single quote mark. Notice: 1. that the d-code is any word beginning with a 'd' (lower case). 2. that with the fields are NOT padded with blanks in the 'd' output. 3. that the codes are all separated by EXACTLY ONE BLANK. ======= revision history ======= Version 1.1 --- 1/29/87 --- added snazzy intuition front-end Version 1.2 --- 2/3/87 added color check to return to Preferences' colors Version 1.3 --- 2/4/87 --- fixed bug in string comparison routine which had (e.g.) evaluated the strings "Amicus1" and "Amicus11" as equal Version 1.4 --- 2/14/87 --- added special feature for transferring fields into database files Version 1.5 --- 3/10/87 --- message now for "no input file named" pointer no longer occasionally turns black date sorting now works properly