home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / finance / eebond10.zip / SDF.DOC < prev    next >
Text File  |  1993-08-13  |  7KB  |  182 lines

  1.  
  2.  
  3.                                    SDF
  4.  
  5.          (C) Copyright 1991-1993 by Alan J. Avery    All rights reserved
  6.  
  7.        Purpose: Converts delimited ASCII files to System Data Format,
  8.                 to dBase 3+ format, to delimited format or to Paradox 3.5
  9.                 or Paradox 4.0 format without requiring any programming
  10.                 by a user.
  11.  
  12.        Developed by Alan J. Avery
  13.                     Elvish Consulting
  14.                     1408 Noble Avenue
  15.                     Springfield, IL 62704-3450
  16.                     (217) 698-8600
  17.  
  18.         If you find SDF to be of value to you, please contribute to
  19.         its development with a contribution ($20 suggested).
  20.  
  21.  
  22.                                DISCLAIMER
  23.  
  24.   The Author specifically disclaims all other warranties, expressed
  25. or implied, including but not limited to, implied warranties of
  26. merchantability and fitness for a particular purpose with respect to
  27. defects in the diskette and documentation, and the program license
  28. granted herein.  In particular, and without limiting operation of the
  29. program license with respect to any particular application, use, or
  30. purpose, in no event shall the Author be liable for any loss of profit
  31. or any other commercial damage, including but not limited to special,
  32. incidental, consequential or other damages.  Your use of this program
  33. constitutes acceptance of these terms.
  34.  
  35.  
  36.                     Table Of Contents
  37.  
  38.  
  39.         Introduction to SDF................................1
  40.         How to Start SDF...................................1
  41.         Commands That Control SDF Behavior.................2
  42.         How SDF Works......................................3
  43.         Errors Reported....................................3
  44.  
  45.         See the COMMANDS.SDF file for a listing and brief
  46.         description of the commands that can be used.
  47.                                                           Page 1
  48.  
  49.  
  50.                      Introduction to SDF
  51.  
  52. Many database programs can 'export' their data to an ASCII file where each
  53. field is (usually) surrounded by quotes and separated from the following
  54. field by a comma.  Two such records might look like this:
  55.  
  56. "Mr.","Alan","J.","Avery","Elvish Consulting","1408 Noble Avenue","","Springfield","IL","62704-3450","(217) 698-8600","USA",""
  57. "","","","","Elvish Consulting","1408 Noble Avenue","","Springfield","IL","62704-3450","(217) 698-8600","USA",""
  58.  
  59. Importing a file of such records into another program can frequently be
  60. done, but problems can arise.  For example, the user attempting to bring
  61. the file into a spreadsheet will be frustrated if one or more lines of the
  62. file exceeds 240 characters in length.  Also, how does the user import the
  63. file into a database if the order of the fields in the ASCII file does not
  64. match the order of the database, or if the lengths of the database fields
  65. are too short for the ASCII file?
  66.  
  67. These are just a few problems that arise when importing ASCII files.
  68. However, they are part of a much larger issue: how can the user exert
  69. control over how the ASCII file is imported?  For example, the user might
  70. want to import only those records where field 3 has the string "Sale" in
  71. it.  Or, the user might want to import only specific fields, and these
  72. might need to be rearranged to fit the need at hand.
  73.  
  74. There are many other control points that users may need to exercise.
  75. However, without programming skills, users are at a disadvantage.
  76.  
  77. SDF is designed to give the user control over delimited ASCII files.
  78. With it, users can specify what fields to keep, which ones to toss,
  79. and a host of other options.  SDF can convert files of ANY length, allows
  80. the user to specify how many fields may exist per line (the default is 500
  81. fields per line), can convert fields to UPPER, lower or Proper case, can
  82. left-justify or right-justify fields, and can search for text in a field
  83. (optionally replacing it with other text).  It can omit any fields from
  84. the file, and adjust the lengths of others so that they are padded or
  85. truncated to the desired length.  It can create a System Data Format file
  86. (all records of identical length, and each record ends with a carriage
  87. return/line feed), a dBase III type database file, a Paradox 3.5 or
  88. Paradox 4.0 database file (with primary and secondary indexes, if desired),
  89. or another delimited ASCII file, which can then be imported.
  90.  
  91.                        How to Start SDF
  92.  
  93. Here's an example.  Suppose you type this from the command line:
  94.  
  95.      SDF  PROCESS.SDF
  96.  
  97. The file called PROCESS.SDF contains commands that control the operation
  98. of SDF.  For example, it specifies the file to convert, the file to create,
  99. the fields to be converted, the order of the fields, etc.
  100.                                                           Page 2
  101.  
  102.                     Commands That Control SDF Behavior
  103.  
  104. Suppose you want to convert INPUT.PRN to an SDF file.  In addition, you
  105. want only fields 2, 1, 12, 11, 13 and 19 to be converted, and you want the
  106. fields rearranged in the output file to be in this order.  Finally, suppose
  107. you want the fields left-justified, with maximum lengths of 60, 50, 23, 50,
  108. 7 and 80 assigned to them.  Here's how you would specify the PROCESS.SDF
  109. file to handle this:
  110.  
  111. Reorder
  112. Surrounded By       "
  113. Delimited By        ,
  114. Input File          INPUT.PRN
  115. Output File         NEWFILE.TXT
  116. Output Format       SDF
  117. Fill With           32
  118.  
  119. Field Number        2
  120. Field Length        60
  121. Justify             Left
  122.  
  123. Field Number        1
  124. Field Length        50
  125. Justify             Left
  126.  
  127. Field Number        12
  128. Field Length        23
  129. Justify             Left
  130.  
  131. Field Number        11
  132. Field Length        50
  133. Justify             Left
  134.  
  135. Field Number        13
  136. Field Length        7
  137. Justify             Left
  138.  
  139. Field Number        19
  140. Field Length        80
  141. Justify             Left
  142.  
  143. There are many more commands that can be applied, and a complete listing
  144. of them, along with a brief description, can be found in the COMMANDS.SDF
  145. file that should have been included with this package.
  146.                                                           Page 3
  147.  
  148.  
  149.  
  150.                               How SDF Works
  151.  
  152. Step 1: SDF reads the ASCII file to determine how many fields are on each
  153.          line and the maximum length needed for each field.
  154.  
  155. Step 2: SDF reads the ASCII file again and, using the information from the
  156.          command file, creates the file desired.
  157.  
  158.  
  159.                              Errors Reported
  160.  
  161.      SDF will report the following conditions as errors:
  162.  
  163.    <name> does not exist.   - File named <name> was not found.
  164.                                Processing stops.
  165.  
  166.    Too many (DDD) fields at
  167.      line LLL of <name>.    - In file named <name>, line LLL has DDD fields
  168.                                in it, which exceeds SDF's capacity.
  169.                                Processing continues.
  170.  
  171.    Line LLL has DDD fields
  172.      in it, but the previous
  173.      line has PPP fields.   - In the file being converted, line LLL does
  174.                                not have the same number of fields as the
  175.                                previous line (PPP).
  176.                                Processing continues.
  177.    
  178.    Not enough memory to satisfy
  179.    request for BBBB bytes   - There is not enough memory to run SDF.
  180.                                Processing stops.
  181.  
  182.