home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / LS341.ZIP / LSORT.HLP < prev    next >
Text File  |  1993-02-27  |  11KB  |  239 lines

  1. LSORT 3.41 (C) Copyright London Computing, 1983-1991.
  2. All rights reserved.
  3.  
  4. LSORT is a general purpose sort/merge utility written in Microsoft C
  5. 6.0 for DOS 3.30 and above and OS2 1.2 and above written as a family
  6. mode application.  It runs on IBM PCs and compatibles with at least
  7. 512KB and either two floppy disks or a fixed disk.
  8.  
  9. LSORT is User Supported Software,  if this program proves useful, please
  10. make a contribution ($35 suggested) to:
  11.  
  12. London Computing, P.O. Box 696  Cherry Hill, NJ 08003
  13.  
  14. Anyone sending a contribution will receive a disk containing the source code
  15. to LSORT as well as a copy of the LSRT sort filter.  LSRT is similar to the
  16. DOS SORT filter but works much faster and will sort on multiple fields.
  17.  
  18. You may make copies of this software and distribute to other users as long as
  19. there is no charge or other consideration and this notice is not removed or
  20. bypassed.
  21.  
  22. LSORT will sort MSDOS and OS2 files and dBase II and dBase III
  23. databases.  (dBase III memo files and FOXPRO memo files are not sorted
  24. but .DBF files will be sorted.) Each file may be sorted using 1 to 32
  25. sort fields.  The file to be sorted may contain either fixed length
  26. records, variable length records or comma delimited records.  Variable
  27. length records are records ending with cr/lf.  Comma delimited records
  28. are variable length records where the fields are also variable length
  29. and separated by a comma.  Character fields may be enclosed in either
  30. single or double quotes.  It will merge up to 5 files using 1 to 32
  31. sort fields.  dBase databases may not be merged.  Any field may be
  32. sorted in either ascending or descending sequence.  LSORT allows for
  33. three user defined field types to be used: X,Y and Z.  You must write
  34. your own comparison subroutine to compare user defined fields.
  35.  
  36. The sort knows about:                       field type
  37.  
  38. binary fields (to 127 bytes)                      B
  39.    Binary Fields are sorted from left to right
  40.    one byte at a time based on the code in each
  41.    position (0-255).  Useful for comparing
  42.    IBM Mainframe style binary numbers.  
  43. packed decimal fields (1-8 bytes) Stored as on    P
  44.    IBM Mainframe computers.  Each digit position
  45.    is stored in 4 bits as a binary value between
  46.    0 and 10.  The digits are stored left to
  47.    right with the rightmost position containing
  48.    a sign, 0x0D for negative, 0x0C or 0x0F for
  49.    positive.  A packed decimal field can store
  50.    between 1 and 15 digits depending on the
  51.    length of the field.  If an invalid sign
  52.    field is specified, the sort won't produce
  53.    what you would expect.  Packed decimal values
  54.    are only meaningful in fixed length record.   
  55. character fields (to 127 bytes)                   C
  56.    Character fields compare up to the first
  57.    binary zero in the field, following the C
  58.    language conventions for character strings.
  59. upper case character fields (sort fields are      U
  60.    translated to upper case before compare)
  61. 2 byte integers in internal  format               I
  62. 4 byte integers in internal format                L
  63. floating point numbers (ieee)                     F
  64. double precision floating point (ieee)            D
  65. zoned decimal  numbers                            N
  66.    (Text format numbers,  Decimals are allowed)
  67.    (LSORT now supports scientific notation as)
  68.    (well, using E notation, eg. .98 == 9.8E-1)
  69.    (xBase N and F fields are sorted as type Z)
  70. 1 byte logical fields (dBase II or III)           T
  71. User defined field type X                         X
  72. User defined field type Y                         Y
  73. User defined field type Z                         Z
  74.  
  75. A zoned decimal number is stored as a character string and may contain
  76. leading and trailing spaces, minus sign, decimal point and digits.
  77.  
  78. NOTE: zoned decimal numbers and comma delimitted files sort very slowly!
  79. The only reasonable field types for comma delimited files are C or N. LSORT
  80. will accept other field types, but the results are undefined.
  81.  
  82.  
  83. LSORT will prompt you for all parameters and file names or you may specify
  84. some or all of the parameters on the command line when you invoke the sort.
  85.  
  86. The maximum record length is 4096 bytes.  Files will be sorted in memory if
  87. possible.
  88.  
  89. Files larger than available memory are sorted in pieces and then merged
  90. together.  If you have a floppy only system, you should have LSORT on the A
  91. drive and the file to be sorted on the B drive.  Place a copy of LSORT on an
  92. otherwise empty disk and use as your A drive.  You may need a formatted empty
  93. disk for work files on the B drive.
  94.  
  95.  
  96. SYNTAX:
  97.  
  98.  
  99. LSORT [-h | -m] -- will prompt you for all necessary information.
  100.  or
  101. LSORT [-h | -m] sort specifications--will take the specification specified and
  102.                                   prompt you for any others.
  103.  
  104. Specify -h if you are using a fixed (hard disk) for your output and
  105. merge files.  This will eliminate mount messages.  This is the default
  106. for LSORT 3.01 and above.  Specify -m if you are using mountable disks
  107. (floppy, Bournouli, etc.).  This allows you to mount disks to contain
  108. work files and output files.
  109.  
  110.  or
  111.  
  112. LSORT -R  -- will restart a sort.
  113.  
  114.  
  115. Sort Specifications:
  116.  
  117. You will be asked to specify either a SORT or MERGE operation.
  118.  
  119. If you ask for a SORT, you may tell LSORT to use either a QUICKSORT or
  120. HEAPSORT for internal sorting.  You will also be asked to specify two
  121. devices to hold merge files if any are needed.  Merge files may be placed on
  122. floppy disk, hard disk or RAM disk.  The specified drive must be large
  123. enough to hold the entire input file.  You will be given the opportunity to
  124. change floppy disks if desired before each merge drive is used and before
  125. the output file is written.  The program will wait for you to press 'Y'
  126. before proceeding.  This is not really a problem for unattended sorting
  127. if you use redirected input or specify all prompts on the command line.
  128.  
  129. If you specify SORT or MERGE you will be prompted for your input file(s) and
  130. output file as well as the definition of the key fields to be used in the
  131. comparisons.  Fields are specified by their starting position and length.
  132. The types of fields have been listed above.
  133.  
  134. The sort specifications may be entered on the command line in the order
  135. requested by LSORT. Each parameter should be separated from the others with
  136. one or more spaces.  You will not be prompted for any specification on the
  137. command line (including requests to change disks).
  138.  
  139. The sort will ask for the following information in the order shown:
  140.  
  141. Type of Sort:  You may reply:
  142. S -- for QUICKSORT
  143. H -- for HEAPSORT
  144.  
  145. Merge Drive 1:  You may reply with any drive letter, although it is best to
  146. specify a fixed disk (if any).
  147.  
  148.  
  149. Merge Drive 2:  This should be different from drive 1 if you are using
  150. floppy disks, but should be a fixed disk if you have one.
  151.  
  152. Name of input file: You may specify any name including drive letter and
  153. path.  Specify :X to use a user specified input routine.
  154.  
  155. Name of output file:  See above.  Specify :X to use a user specified output
  156. routine.
  157.  
  158. File Type (Unless you are sorting a dBase file):  You may reply F for a
  159. fixed length file (all records are the same length), V for a varying
  160. length file (records must end with CR LF.) or D for comma delimited files.
  161.  
  162.  
  163. If you entered 'F' for a fixed file, you will be prompted for the record
  164. length.
  165.  
  166. You will then be prompted for field definitions.  Each field definition has
  167. four parts:    starting position (from 1)  or  starting field (delimited files)
  168.                field length (in bytes)         (no prompt for delimited files)
  169.                field type (See above list of valid types)
  170.                sort order (A--Ascending, D--Descending)
  171.  
  172. In order to work as efficiently as possible, LSORT does not check the
  173. starting position of a field against the actual length of a record.  If some
  174. field starts past the end of a record (e.g. sort field 1 starts in column 10
  175. but the record is only 8 bytes long), the results will be undefined and most
  176. certainly not what you want.  Please be careful.
  177.  
  178. Enter a '0' for the starting position to end the prompt for field
  179. definitions.
  180.  
  181. If you are sorting a dBase file, you will see a list of fields.  You may
  182. specify a field by name, in which case you will only be prompted for the
  183. sort order or you may enter starting position, length, type and order as
  184. above.
  185.  
  186. Following the '0' that ends field definitions, you may specify a series of
  187. 'Y's if you know that the disks currently mounted will hold merge work files
  188. and the output file.  These may be omitted if you specified the -H flag.
  189.  
  190. example 1:
  191.  
  192. Sort file test.dat on positions 1-5,char,ascending and 6-7, binary integer,
  193. descending.  Use drive C for the work files and put the sorted file in
  194. test.srt.
  195.  
  196. Issue the following command:
  197.  
  198. LSORT S C C test.dat test.srt V 1 5 C A 6 2 H D 0 Y Y Y
  199.       | | | |        |        | |_____| |_____| | | | |
  200.       | | | input    output   F |       |       | | | response to mount
  201.       | | | file     file     i sort    sort    | | | output file message.
  202.       | | | name     name     l field 1 field 2 | | |
  203.       | | |                   e starts  starts  | | response to mount 2nd
  204.       | | merge drive 2         at byte at byte | | merge volume message.
  205.       | |                     T 1, is 5 6, is 2 | |
  206.       | merge drive 1         y byte    byte    | response to mount first
  207.       |                       p char-   long    | merge volume message.
  208.       sort using              e acter   integer |
  209.       quicksort                 string  sorted  ends list of sort fields.
  210.                                 ascend- descend-
  211.                                 ing     ing
  212.  
  213.  
  214.  
  215. Merge Specification:
  216.  
  217. Enter 'M' to indicate the merge operation.
  218.  
  219. You will be asked to enter the number of files to be merged followed by 1-5
  220. files to be merged. They are entered one at a time.
  221.  
  222. You will be asked to enter a file type, output file and a field list as
  223. above.
  224.  
  225. example:
  226.  
  227. Merge files t1.dat t2.dat and t3.dat on positions 4-7 defined as a character
  228. field, ascending.
  229.  
  230. LSORT M 3 t1.dat t2.dat t3.dat   test.mrg V 4 4 c a 0 y y
  231.       | | |      |      |        |        | |_____| | |_|
  232.       | | input  input  input    output   | |       | |
  233.       | | file 1 file 2 file 3   file     | merge   | response to mount
  234.       | |                                 | field   | messages
  235.       | merge 3 files                     | 1       |
  236.       |                                   |         end of list of merge
  237.       do a merge                          file      fields
  238.                                           type
  239.