dBase File Converter 
by Ian Stewart

As there are very few RISC OS databases that can read dBase files, this program converts dBase files into CSV files. CSV files can be read by most RISC OS spreadsheets and databases.

dBConv can only read non-password protected dBase files, and cannot convert 'Memo' fields.

Before a dBase file can be read by dBConv, its filetype must be set to &012.

Two sample files are supplied inside the dBConv application

Loading dBConv
==============

Double-click on the dBConv icon in the Filer window to install the dBConv icon on the icon bar.

dBConv Menu
===========

Clicking Menu on the dBConv icon pops up a menu with the following items:

Info     - Information about the program.

Options  - Opens the Converter Options window.

Quit     - Exits the program.

The Converter Options window allows you to specify how the CSV file is created. It consists of the following items:

Field separator - In CSV files, a comma is used to separate fields. By changing this, it is possible to create other types of files. For example, a Tab Separated Value (TSV) file can be created by replacing the comma with '|I'. The program uses standard GS translation. (i.e. '|J' for a linefeed.)

Trim spaces - If this is selected, any extra spaces on either side of a field will be removed.

Quotes around characters - If this is selected, quotes will be placed around any 'character' fields.

Quotes around numbers - If this is selected, quotes will be placed around any 'numeric' fields.

Quotes around dates - If this is selected, quotes will be placed around any 'date' fields.

Quotes around logic - If this is selected, quotes will be placed around any 'logic' fields.

Clicking Select or Adjust on the 'OK' icon without changing the filename will save the current options as the default.

Using dBConv
============

Double-clicking on a dBase file icon, or dropping it on the dBConv icon on the icon bar, will open the dBase Converter window. 

The window shows the first field's name, size and type. You can view the other fields by clicking on the up and down arrow icons. Clicking Menu will pop up the Fields menu. Clicking on any field in the menu will display it in the window. The two other menu items are:

Erase    - Selecting this marks the field as 'deleted'. The field's contents will not be included when the CSV file is created. The Erase option will be replaced with UnErase if the field is already marked as deleted.

'Save'   - Allows you to save just the field information, not the contents.

Clicking on the right arrow icon next to the field type will pop up the Formats menu. The items in this menu allow you to specify how the field's contents are converted. 

Characters can be forced to upper-case, lower-case or initial case (all characters are forced to lower-case except the first letter of a word).

Numeric types can be forced to integers or floating numbers (zeros are deleted after the decimal point, e.g. 4.56 instead of 4.5600).

Dates can be formated in several ways:

dd/mm/yy
mm/dd/yy
dd-mon-yy
dd/mm/yyyy
mm/dd/yyyy
dd-mon-yyyy

'dd' is the day of the month, 'mm' is the month number, 'yy' is the year without the century, 'yyyy' is the year with the century and 'mon' is the first three letters of the month name.

To convert the file, drag the CSV icon to a Filer window or any spreadsheet or database that reads CSV files.

History
=======

dBase is the 'industry standard' database file structure. Any database for the PC that does not read and write dBase files is not worth the disc it's stored on. There are several versions of dBase, but the file structure has remained virtually the same and is very simple. The first part is a header which holds all the information about the file (field length, total number of records, last date used, etc.). The rest of the file is one long piece of data. There are no end of field or record markings. Every record has the same length, and by dividing the data by the record length, the start of each record can be calculated.

A CSV file is very similar to an ASCII text file - only the essential information is saved. The contents of each field are placed in quotes, every field in a record is separated by a comma, and every record is placed on a new line. 

i.e.

Record 1:     "A JONES","12 MAIN ROAD","THIS TOWN"
Record 2:     "P SMITH","9 DALE STREET","OTHER TOWN"
Record 3:     "T TAYLOR","121 SUTTON GROVE","ANY TOWN"
etc.

 RISC User 1993