Database Import Facility is a utility to take unstructured ASCII information and simply and easily get it into a comma-delimited format for easy import into word processors or database managements systems.

Database Import Facility by John L. Dove III Version 1.4 April 10, 1990

1. What is it?

Database Import Facility is a utility to take unstructured ASCII information and simply and easily get it into a comma- delimited format for easy import into word processors or database managements systems. It uses the keyboard to highlight blocks of characters and place the blocks into user-specified fields. You monitor your progress with a Field view which shows the contents of each field as you go. When you have a complete record entered, you can then save it to disk with each field surrounded by double quotes and separated by commas.

2. Let's run it!

a. Database Import Facility Syntax

Run Database Import Facility by typing the following at the command line:

C:\DIMPORT [Infile] [OutFile][ underlined part )

where [Infile] is an optional input filename [Outfile] is an optional output filename, and [ NOTE: If you don't enter a filename, you will be asked for the filenames at the beginning.

b. Input Filename

You will first be asked for the input file. You will now see the prompt shown in Figure 1, asking you to either confirm the name you placed on the command line, or to enter a new filename, if you didn't enter one on the command line. Just type in the name of the file from which you wish to get the raw ASCII lines to convert. Use your [Left Arrow] and [Right Arrow] to move around the name to correct it. The program will check for the existence of the file and ask you to re-enter the name if it cannot find it.

mark (?) as the first character of the filename and you will see a full-screen directory as shown in Figure 2. Use the arrow keys to move the cursor to the input file of your choice and press [Enter]. Directories are shown with a backslash following the name. To move to these other directories, simply place the cursor on the directory name and press [Enter].

If you don't specify an output filename, you'll see the input filename with an extension of ".CDF" attached. This stands for Comma-Delimited Format, a common input format for database management systems and some word processor mail merge. If you wish another extension, simply delete the extension and rename the output filename. See Figure 3.

If you enter a filename which already exists, the program will ask if you want to Overwrite the existing file (i.e., to delete it and all information it contains) or to Append to it (i.e., add new information to the end of the file). See Figure 4. This is useful if you have to stop in the middle of a conversion effort. Just re-start in the Append mode to continue (more on this later).

When you have completed converting all your input files into CDF files, you will import your CDF files into a database management program with the fieldnames identical to those you used to save you data. You must create a list of these field names and save the list to a file. The default filename Database Import Facility seeks is DBFIELDS.IN. See Figure 5.

You may accept this filename by pressing [Enter] or directly type the name of your database fields filename or enter a [?] and select from a directory.

e. Main Work Screen

(1) Output Fields

You'll need a file on disk called DBFIELDS.IN which contains all the fields you want to capture. Database Import Facility loads this file and displays the fields at the top of the screen, as shown in Figure 6. At the right of each fields will be shown about 20 characters of the value you enter in this field. If you edit the field, you'll get to edit the full value.

At the bottom on the screen, you'll find the work area where you'll see the lines of text from your source file (See Figure 6). Here you will mark blocks of characters to transfer into the Output fields above. Below the Box, you'll find the Menu Bar which can be activated by pressing the letter of the selection. When you press [B], for example, you'll get a pop-up menu with additional choices as shown in Figure 7.

These pop-up menus serve two purposes:

1. Choose a letter and perform the function, and, 2. The pop-up menu shows the synonym key you can use to access the function directly.

(a) Buffer Pop-up

Figure 7. These commands address the input buffer of ASCII lines. You have the option of pressing [S] to show the list of lines currently in the input buffer, [F] to find a string in the input file, [E] to edit the current line shown in the input buffer window, [T] to move back to the top of the input file, [N] to bring the Next line into the Cut and Snip area or [P] to move back to the Previous line in. Database Import Facility knows if you have a Next line ready or not, and retrieves another line into the buffer as you need it. Notice the single keys [F9], [AltF], [AltT], [PgDn], and [PgUp] can be used to perform these functions without using the pop-up menus.

Figure 8. This Pop-Up menu collects together the commands for manipulating individual fields and whole records. You have the option of pressing [S] to Store a marked block in an output field, [P] to strip periods from a marked block and then store to a field (useful for converting N.Y. to NY, for example), [D] to delete the current value of a field, [E] to edit the values

DATABASE IMPORT FACILITY Page 5

currently stored in the fields, [W] to write the collected fields out to the output file, [C] to choose which fields are to be carried forward when the record is saved to disk, [L] to list the first five fields of the records which have already been written out to disk (useful if you've forgotten what the last record you wrote). Notice that all the functions have single keys which perform the function without the need for this Pop-up Menu.

Figure 9. This Pop-up Menu contains the commands for highlighting blocks for transfer to fields. You can press [B] to mark the beginning of a block, [E] to mark the end of a block, [N] to move the highlight to the Next block of characters, [X] to extend the highlight to the next block, [P] to highlight the previous collection of characters and [U] to remove the highlight. You'll find that the single key functions will be much easier to use as you get more experienced with the facility.

Figure 10. This provides immediate assistance about Database Import Facility. In a way, each individual Pop-Up Menu is a Help screen providing instant key equivalences. Press any key to get the next page of help.

When you choose to Quit, Database Import Facility checks to see if all input records have been loaded. If not, you're asked if you really want to quit with more records to process, as shown in Figure 11. If all records have been loaded, you are simply asked if confirm that your want to quit.

(1) [] Move cursor one column to the left or right. If the cursor is in a Highlight, it will drag the highlight with it as it moves.

(2) [Ctl][] Move the cursor one word at a time. If the cursor is in a Highlight, it will drag the Highlight to the next word.

(3) [Home]/[End] These keys move the cursor to the Beginning or End of the line, respectively. This is useful to highlight the whole line. The first block is always highlighted; pressing [End] moves the highlight over the complete line.

b. Buffer keys

(1) [F9] Show current Buffer. This shows the current buffer of 20 lines from the input file. You may scroll up and down this display and select a line to go directly to a line. This is useful if you are not exactly sure where you are. See Figure 14.

Use the [Up Arrow], [Down Arrow], [Home], [End] to move the cursor to the buffer line you wish to selection. Press [Enter] to select and place this line into the Cut and Snip area for parsing. If you press [Esc], the Cut and Snip area will contain the same line as when you brought up the line buffer.

(2) [AltF] Find a string in the input file. You will be asked to enter the string to search for. The program will begin with the current record and search through the rest of the file for the string. The search is case-insensitive (i.e., you may enter any combination of capital and lower case letters and it will match any combination of characters in the file).

(3) [AltT] Return to the Top of the input file. This is a useful command when you have searched for a string and reached the end of the file with no success. Use this command to start over at the beginning of the file with the next search.

(4) [Shift-F7] Edit the current input buffer line. Press this to directly edit the input buffer line showing in the Cut and Snip window. The changed line can now be stored in any field.

(5) [PgDn] Get next line from buffer. When at the bottom of the buffer, a new line is then read into the buffer from the source file.

(6) [PgUp] Get previous line from the buffer. This is useful you have to capture information you missed. If you lose your place in the buffer, use [F9] to find it.

c. Fields/Records Keys

(1) [F2]/[Enter] This stores a highlighted (marked) block of characters in one of the Output fields shown on the top of the screen. This is one of the most common actions you'll take, so the default is the [Enter] key.

(2) [.] (Period key). This works just like the [F2] key, except that all periods are removed before the block is stored. This is specifically for removing the periods from an old-fashioned State abbreviation (e.g., N.Y. becomes NY).

DATABASE IMPORT FACILITY Page 9

SPECIAL FEATURES with the Store keys. When you Store block in a field, several things happen. The highlight is advanced to the next block, the field pointer is advanced so that the next Store command will automatically default to the next field. This is useful when storing City, followed by State, followed by Zip. This is the normal sequence, so the keystrokes would be to press [Enter] to store the City, enter the field number and press [Enter]. After it's stored, the highlight moves to the State. Just press [Enter] twice (or press [.] and then [Enter]) and the State abbreviation will be stored in the State field. Press [Enter] twice more and the Zip Code will be stored.

(3) [Del] Delete the value in a chosen field.

(4) [F7] Edit a field of your choice. You'll get a larger window, to see the total field for editing purposes.

SPECIAL FEATURES with Del and Edit keys. If you find you have to Delete or Edit a field, do so immediately after you store it in the field. This will allow you to take advantage of the feature which keeps the most recent Field number for Delete or Edit. Simply pressing [Del] and [Enter] will kill the most recently filled field. Similarly for Edit.

(5) [F8] Write the current collection of fields to disk under the Output filename. As an aid to continued actions, the fields are blanked after they have been written to disk. For fields which are Carried Forward, the fields are not cleared.

(6) [AltC] Mark fields to carry forward from record to record. If you are processing records with numerous identical fields, choose [AltC] to mark the repeating fields. Marked fields are shown with their field numbers highlighted in the Fields Window.

(7) [F6] Show a list of all records written to disk so far. Just the first five fields of each written record are shown; the last 20 records written are shown.

d. Marking Blocks

(1) [F3] Mark (or highlight) the beginning of a block

DATABASE IMPORT FACILITY Page 10

(2) [F4] Mark the end of a block

(3) [+] Highlight the next block of characters. Blocks of characters are separated by spaces and/or punctuation marks.

(4) [Shf][+] [Shift] and the [Grey Plus] sign, will move to the next block, dragging the highlight along with it. This is useful for highlighting names like "New York" or "Salt Lake City."

(5) [-] Highlight the previous block. This is useful if you find you forgot to save one of the previous blocks.

(6) [F5] Un-highlight or un-mark the block.

e. Help Keys

(1) [F1] This provides several pages of explanation for the program as well as help with useful keys. Note that the Menu Bars also provide key help, since every selection has its function key equivalent.

f. Quit Key

(1) [Q] This key exits Database Import Facility, asking you to confirm that your really want to quit. As mentioned before, if you have not loaded all the source lines, you will be advised and asked if you really want to quit.

4. CardWare, or How do I register?

This software is copyrighted by John L. Dove III and all rights have been reserved. It is being distributed under the new concept of Cardware: If you use the software, you must register it by sending, as a minimum, one Postcard to me at this address:

John L. Dove III P.O. Box 15413 Arlington, VA 22215-0413

Please indicate your name and address and the version you are currently using. If you do not wish to register, please remove the software from your system. In any event, please pass the complete file (including this DOCumentation file) on to your friends. (If you feel you must provide a donation, it will be gratefully accepted.)