home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / qad12.zip / QAD.DOC < prev    next >
Text File  |  1988-07-10  |  10KB  |  224 lines

  1. Quick And Dirty (QAD), an ASCII to Delimited File Converter. 
  2.  
  3. VERSION 1.2.  The program should now work well with any type of
  4. screen: MDPA, HERC, CGA, EGA and VGA.  The first version did not 
  5. display correctly on monochrome screens and the second version that 
  6. I put out to BBS's apparently still had the old version of QAD.EXE 
  7. even though the QAD.BAS file had all the fixes in it.
  8.  
  9.  
  10. Written and Copyrighted by    Kenneth B. Gash 
  11.                               6534 Eddinghill Drive 
  12.                               Rancho Palos Verdes, CA 90274 
  13.  
  14. I was submitting this utility program as SHAREWARE, but since I don't like
  15. receiving programs that don't work well any better than you do, I am now
  16. removing any requests for money.  If you find it as useful as I think you will
  17. (presuming you have an application for it), I would like to know about it. 
  18. Please leave me a message on the BBS where you found this program to tell 
  19. me it works, or it stinks or what can be done to improve it.  Thanks.
  20.  
  21. Program Description 
  22. -------------------- 
  23.  
  24. This program takes ASCII records conforming to certain simple 
  25. rules and allows you to "delimit" those records into whatever 
  26. fields you like.  It can be used to convert data obtainable from 
  27. mainframe downloads, from data bases and spreadsheets which do 
  28. not export files in anything useful except ASCII and for files 
  29. ported from other systems as ASCII records. 
  30.  
  31. It is entitled Quick And Dirty (QAD) because it was designed to 
  32. be a working utility with no bells and whistles. 
  33.  
  34. Data bases are wonderful tools for manipulating large amounts of 
  35. data, but the data has to be entered before it can be 
  36. manipulated.  Usually, the data is entered from the keyboard, 
  37. which can be a very tedious process. 
  38.  
  39. On the other hand, data is often available as an ASCII list or 
  40. table which can be accessed with a word processor and can be sent 
  41. to a printer for hard copy.  Unfortunately, it is usually not in 
  42. a form which is "importable" by standard data base programs.  I 
  43. work at a university and I often access the central mainframe 
  44. computer for student and course schedule data.  The people at the 
  45. computer center produced files containing many records of 
  46. ASCII data which I would then have to type into my PC for further 
  47. analyses and manipulation.  This program is the result of my 
  48. frustration with this method of getting data into a data base. 
  49.  
  50. Any collection of ASCII data that conforms to some simple rules 
  51. can be converted by this program to be imported into dBASE III, 
  52. REFLEX, or any other program which can recognize "delimited" 
  53. ASCII data files.  A delimited data file is one in which each of 
  54. the fields in a record is separated from the next field by one or more
  55. delimiters.  This program uses two delimiters: the comma (,) and 
  56. the quotation mark (").   
  57.  
  58. The program also is able to do some manipulation of the data as 
  59. it is delimiting it.  One of the most common types of data bases 
  60. is a collection of names and addresses (which may also contain 
  61. additional data).  In many cases, names are stored in as 
  62. LASTNAME,FIRSTNAME MI.  This form is quite useful for sorting of 
  63. the lists but it is not very useful for generating mailing lists.  
  64. The program can convert names stored in this form to a delimited 
  65. LASTNAME, and a delimited FIRSTNAME MI.  If you try to use this 
  66. feature on a field without a comma, the program will not allow it.
  67.  
  68. The program is also able to do "Proper Case Conversion" which means
  69. that it will take an alphanumeric field that contains UPPER CASE
  70. STRINGS and convert it to "Proper Case Strings" where only the
  71. first character of each word is upper case.  This again is useful
  72. in converting name and address files obtained from various sources
  73. since they are often stored as upper case only files. 
  74.  
  75. The "Rules" for the file to be converted are: 
  76.  
  77.      1.   Each record of the file must be contained in a single 
  78.           line with no carriage returns or linefeeds. 
  79.  
  80.      2.   Each record of the file must be made up of the same 
  81.           number and type of fixed length fields.  
  82.  
  83.      3.   The total number of characters in each record should be 
  84.           no more than 240.  This program is written in BASIC 
  85.           which limits string length to 255 so 240 is set to 
  86.           leave room for the delimiters. 
  87.  
  88.      4.   Name fields which are to be delimited into first and 
  89.           last name fields MUST have a comma separating the 
  90.           LASTNAME and FIRSTNAME in the original field.  The 
  91.           program searches for the presence of a comma then 
  92.           proceeds to separate the two parts of the name at that 
  93.           position. 
  94.  
  95.      5.   When Proper Case Conversion is used, it may require some
  96.           touching up with a text editor (Henry Smith Iii or Po Box
  97.           or John, Jr. Jones or other minor errors will occur). 
  98.  
  99. Using the Program 
  100. ----------------- 
  101.  
  102. THe program was written in BASIC and compiled with Microsoft 
  103. Quick Basic 4.0.  I have included the source file in case anyone 
  104. wants to modify the program, but the program runs fastest as 
  105. QAD.EXE. 
  106.  
  107. Enter QAD 
  108.  
  109. Enter the full pathname of the file to convert.
  110.  
  111. The program adds the extension .PRN if there was no extension.  
  112. If you don't like the default output file name, change it before 
  113. hitting enter. 
  114.  
  115. The program then places the first record in the input file on the 
  116. screen, gives its length in bytes and asks: 
  117.       
  118.      IS THIS A GOOD RECORD (Y OR N)? 
  119.  
  120. A "good" record is one which contains few if any null or blank 
  121. fields so that it would be useful for marking appropriate fields 
  122. for delineating. 
  123.  
  124. Once you find a good record and hit 'Y', the record is re-written 
  125. on the screen with the cursor activated to mark fields. 
  126.  
  127. To mark a field, move the cursor using the left and right arrows 
  128. on the number pad so that the cursor is on the character just to 
  129. the right of the last character in the field to be marked. 
  130.  
  131.      Hit 'C' if you want the field to be separated by a COMMA 
  132.  
  133.      Hit 'Q' if you want both quotes and commas.   
  134.  
  135.      Hit 'N' if the field contains a name, WITH A COMMA 
  136.      SEPARATING THE TWO PARTS OF THE NAME, and you want the first 
  137.      and last names automatically delimited as separate fields.  
  138.      This function uses only the QUOTE and COMMA delimiting.  
  139.      **CAUTION -- THIS FUNCTION WILL CAUSE THE PROGRAM TO CRASH 
  140.      IF IT TRIES TO DELIMIT A FIELD WHERE THERE IS NO COMMA. 
  141.  
  142. While marking fields, you can do things like separating area 
  143. codes and/or dashes from telephone numbers, marking fields that are 
  144. not needed so that they may be discarded by your application 
  145. program and shortening the total record by a fixed amount.  The 
  146. latter is done by simply not marking the entire record if the 
  147. last part of it contains unwanted information. 
  148.  
  149. It is important to note that the last field you want MUST be fully 
  150. marked.  Don't worry if it appears to have a trailing comma, that 
  151. will be removed in the conversion. 
  152.  
  153. As you are marking the fields, you will notice that the Field 
  154. Number, Field Length and Total Length Marked are shown on the 
  155. screen.  This feature is useful if you know the exact record 
  156. layout of the ASCII string you want to delimit and some of the 
  157. fields appear blank on the screen. 
  158.  
  159. When all fields are marked, hit the ENTER key.  You will then be 
  160. asked if you want to do Lower Case Conversion.  If you answer 
  161. 'N', you will be presented with a list the fields you have marked 
  162. to check.  If everything looks OK, hit the enter key.  If you 
  163. detect something wrong, hit the BACKSLASH (\) key to start over.  
  164. This key can be hit any time during the field marking procedure 
  165. to abort and start again.  I'm afraid if you want to quit without 
  166. actually converting data, you must hit <Ctrl><Break> to get out 
  167. of the program.  No frills, remember? 
  168.  
  169. If you select Lower Case Conversion, each marked field will be 
  170. presented in order and you will be asked to enter 'Y' or 'N'. 
  171.  
  172. Finally, when the list is done and you hit the ENTER key, the 
  173. conversion begins.  If you have lots of lower case conversions, 
  174. the conversion is slowed down somewhat.   
  175.  
  176. Summary 
  177. ------- 
  178.  
  179. 1.   From the directory containing QAD.EXE, enter QAD. 
  180.  
  181. 2.   Type in the full pathname of the ASCII file to be converted. 
  182.  
  183. 3.   Accept the default output file or type in a new pathname. 
  184.  
  185. 4.   Proceed to move the cursor with the arrow keys and mark the 
  186.      fields. 
  187.  
  188. 5.   When all fields are marked, hit the ENTER key, answer the 
  189.      questions about lower case conversions and proceed to get 
  190.      your data converted. 
  191.  
  192.  
  193.  
  194. Cautions 
  195. -------- 
  196.  
  197. Since there is little or no error checking, your input file must 
  198. be "clean" or your output file may wind up with some strange 
  199. formats.  Of course, the input file is not changed in any way, so 
  200. no real harm done. 
  201.  
  202. The values I have chosen for the cursor highlight, foreground and 
  203. background and other colors used in marking the fields may not be 
  204. fully appropriate for your monitor.  I have checked them on CGA, 
  205. EGA, VGA and Hercules type monitors, but variations do exist.  If 
  206. that is the case, you should experiment with different values of 
  207. the values in LINE 80 and the value of PCOL in line 30.  
  208. Remember, MONO screens (including Hercules) have their screen 
  209. memory starting at &HB000 while color screens start at &HB800.  
  210. Of course, you should recompile (using Quick Basic, any version) 
  211. for speed. 
  212.  
  213. It is not a good idea to use files with the .PRN extension as 
  214. input files.  If you do, and you do not rename the DEFAULT output 
  215. file, the program will crash since it will try to open the INPUT 
  216. file for OUTPUT! 
  217.  
  218.  
  219. Final Reminder. 
  220. --------------- 
  221.  
  222. If you find this program useful or if you don't think it works correctly, send
  223. me a message to that effect.  Thanks.
  224.