home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / c / bigsort.arc / READ.ME < prev   
Text File  |  1986-04-21  |  4KB  |  90 lines

  1.               BIGSORT.C
  2.  
  3.  
  4. Reverse Engineered UNIX (tm) inspired sort
  5. Copyright (c) Jim Gast, Naperville, IL    April, 1986
  6.  
  7. The fundamental difference between this sort and all the other sorts I have
  8. seen is that THIS one will sort any reasonable size file that will fit in
  9. the amount of free memory you have. I have used it to sort a 200K file.
  10.  
  11. SYNTAX:   bigsort [ -tx ] [+dd.dd[n][r]] [-dd.dd] . . .
  12.         [infile] . . . [-o outfile]
  13.     "-t;" specifies a new tab (delimeter) character (default is tab).
  14.          In this example, the delimeter is semicolon.
  15.     "+5.6 -6.0" means that a key starts at the 5th delimeter plus
  16.              six more characters, and ends at the sixth delimeter
  17. "n" appended to any key specifier makes it a numeric comparison
  18. "r" appended to any key specifier makes it sort into reverse order.
  19.  
  20. The fields in each record can be variable length or fixed length. If they
  21. are fixed length use character number (e.g. 0.234). If they are variable
  22. length either use the TAB character to separate fields (exactly one TAB per
  23. field) or substitute any other character for the delimeter and use the "-t"
  24. option to tell BIGSORT which character.
  25.  
  26. MAXIMUMS:    5000 records
  27.         20 Keys per record
  28.         512 bytes per record
  29.         50 input files per merge
  30.  
  31. If you don't like those maximums, change the defines and recompile!
  32.  
  33. You can specify multiple keys. Each key consists of a starting location
  34. prefixed by a "+" and an optional ending location prefixed by a "-".
  35. The later keys are used only if all earlier keys matched. For example,
  36. "+2 -3 +0" means the primary key is from the 2nd tab to the 3rd tab,
  37. and ties are broken by starting at the 0th tab.
  38.  
  39. If you specify more than one infile, the files are merged.
  40.  
  41. If no input files are specified, input is read from standard input.
  42.  
  43. If no output file is specified, output is written to standard output.
  44.  
  45.  Assuming a file that contained:
  46.     accountname;name;address;balance;phone number
  47.  
  48.  Example record:
  49.     0023Flint;Flintstone, Fred;43 Quarry Lane;120.00;355-9881
  50.  
  51.  SAMPLE sorts:
  52.     sort people -o acctsort
  53.         sorts by accountname and puts the output in file "namesort".
  54.     sort -t; +3n -4 +0 people
  55.         sorts by balance (numerically), and accountname if the
  56.         balance is the same. outputs to stdout.
  57.         The "-t;" changes the tab (field delimeter) to semicolon.
  58.         Note that "+3n" skips to the field after the 3rd delimeter,
  59.         you might think of it as the 4th field.
  60.     sort +0.4 people
  61.         sortkey starts with the 5th character (skips 4).
  62.  
  63. If your database has fixed length records and you want to sort based
  64. on the characters from the 83rd character to the 93rd in descending
  65. alphabetical order:
  66.     sort +0.82r -0.92 frecords -o forder
  67.  
  68. HINT: using infile and -o outfile executes much faster than using "<" and ">"
  69. for standard input and standard output, especially on large files.
  70.  
  71. This program was compiled under CI-86, and depends on the CI-86 routine
  72. qsort(). To sort any decent size file it was compiled with BIG model.
  73.  
  74. I tried to include the crucial features of the UNIX(tm) sort command. A
  75. logical enhancement would be to have an option that treats all upper case
  76. letters as lower case, but I haven't yet needed it.
  77.  
  78. If someone out there is ambitious, you could modify it to allow star
  79. convention in input file names.
  80.  
  81. Have fun, and write me if you have any questions, enhancements, or
  82. suggestions.
  83.  
  84. This program is SHAREWARE, an $8.00 donation puts you on my mailing
  85. list to receive the next version of this and my screen utilities.
  86.  
  87.         Jim Gast
  88.         16 N. Columbia
  89.         Naperville, IL 60540
  90.