Data Import using CSV file
Note: This utility is only available to licensed Visual Foxpro Development Systems
To import a CSV (Comma Separated Text file) ..
Open your UniRes company from the Company Selection Window ..
With the Screen showing the Command Centre ...
From the Top menu Bar ... Select - Utilities Installation Utilities - Import Data
Importation is a seven step process.
Skills Required ...
This text describes how the import is done. It is NOT intended as a tutorial and is for those of you who have an advanced understanding of databases, tables, programming and computer skills in general.
Note
If you feel you are out of your depth, call support for help. All help with respect to importing data will be charged out at our hourly rates (get a quote is uncertain).
If you are attempting an import, BE SURE TO MAKE A BACKUP OF YOUR UNIRES COMPANY DATA FIRST. Also make sure you are the only user using UniRes (no other workstation should have UniRes open!
Fig 1.
New Table or Existing Table
New Table - Just imports the data csv file into a new table creating database fields that match the first line field names in the csv file.
Existing Table - If you select Existing Table, you must select the data file to receive the impoted fields, BUT you must specify which column headings in record 1 match the data table field name in the existing data file.See Fig 1a - Define imported Fields.
To be able to do this, you must know before hand the meaning of the field names, so you will need to refer to the data dictionary for UniRes.
The only data dictionary available is for the Booking File and the Customer Master File (if you have the optional Invoicing addd-on.
Fig 1a ( If using Existing Table - Import) ie. unbook.dbf, unbooh.dbf, or uncust.dbf)
You should never import transactional data. This will produce unpredictable errors.
Heres how it works...
The existing data file has known field names ie. Bm8 is the Surname of a booking, Bm9 is the First Names etc. Initially the grid is matched 1 for 1, 2 for 2 etc in the order of the column headings 1 to the last ..
Line 1 of the CSV is shown ie. Co./Last Name is under Bm8, but if it was under a different field in the existing data file, you will have to maybe first make it an "UnAssigned Field" (last choice in the Name: drop down box) and pick now the available data file field - the incorrect field, so that it will appear under Bm9. Cofused? Just try it and you will see that you can assign only the fields that are shown as solid field names in the list (all may have been incorrectlt assigned).
So you see its important to produce a xls sheet which have the columns in the correct order for importing!
Select Text File. - The name of your CSV file created by your Excel spread sheet (XLS file) - Exported data as a CSV file, Comma separated fields.
New Table - you will create a new table based on the CSV field names in line 1 of the CSV file.
Fig 2.
Sample of what the XLS might look like ...
The column names can be equated to Database Names further on in the Inport process .. see below.
CSV Text file below shows line 1 fields contain the Column Headings and become the database field names which hold the actual data.
Line 2 onwards contain the actual data...
Fig 3.
Select Data Format "Delimited" . The delimiter is the comma between data fields as you can see from the example which shows you the field data structure.
Set the import to start at row 2 as row 1 is used to record the field names.
Fig 4.
Just accept the defaults as per fig 5.
Fig 5.
Click on "Finish " to start the import. A data table is created in .dbf format suitable for appending to you table.
Fig 6.
After the import is completed, A new stand alone data file will have been created (a .dbf file)
==================================================================
To Add the imported file to an existing file, we Append the file to existing file.
Note that UniRes may not function correctly if a mistake is made during an import. Therefore we strongly advise you get assistance from UniRes support.
You will have to provide your customer number when requesting support for UniRes Import Help.
======================================================================
Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files