Data Transfer
SoftWright Home
Q: Can I transfer data in my .XLS or .CSV files into the .DBF files used in several TAP databases?
A: With TAP6.0.2416 or later and a Maintenance Subscription date of October 31, 2011, or later, you can use the “XLStoDBF” utility in TAP.
Note that all values in this example are for demonstration purposes only. You should determine appropriate settings for your application.
The native database format for numerous TAP files (Fixed Facility, AutoPath data, HDSpectrum data, etc.) is the dBase (.DBF) file format. In most cases, the TAP application provides an import function to read files in the Microsoft Excel™ .XLS or comma-delimited .CSV formats into the .DBF files.
With the TAP release and Maintenance Subscription noted above, you can use the XLStoDBF utility for those cases where it is more convenient to convert data files before running the TAP application. For example, you may want to use your own software to create a data file in the .CSV format containing records to be processed by AutoPath. The XLStoDBF utility enables you to create your file and then to convert it to the AutoPath .DBF format before running AutoPath.
The XLStoDBF command line syntax is described below:
SWHDXLStoDBF.exe /SOURCE=mysource [/TARGET=mytarget] [/TYPE=type] [/SHEET=myxlssheet]
Where
SWHDXLStoDBF is the application name. If you are launching from another program or from the Windows, you will need to include the complete folder name where TAP is installed.
mysource is the complete path and file name (including the file extent) of the XLS or CSV file you want to transfer
mytarget [optional] is the complete
path and file name (including the file extent) of the DBF file you want to create
or add to. If the target file exists the records from mysource will be appended into the
file. If the file does not exist, a new file will be created.
If no target file is specified, the path and file name of the mysource file will be used with
the .DBF file extent.
type [optional] is the database type used
in TAP to identify the data fields used for different TAP functions. If this
argument is not present, the program will read the mysource file and add the records into an existing or
newly-created mytarget
file. However, note the following exceptions. If the mysource file contains any data
fields (or columns in the XLS or CSV view of the file) that are not already a
part of an existing mytarget
file, the data transfer will be cancelled by the program. Including the type argument is an added
precaution for ensuring the data transfer is made into the correct database
type.
For example, if you want to transfer an XLS file of AutoPath records and you
inadvertently specify a DBF file for HDSpectrum as the mytarget file, the type argument provides and
additional check before the program attempts to transfer the data records.
TAP Database types include:
AUTOPATH TAP AutoPath
data file
FACDBASE TAP Fixed
Facility database
IMDDBASE TAP HDSpectrum
intermod data
myxlssheet is the “Sheet name” for XLS files. The default is “’Sheet1’$” If no sheet name is specified and the XLS file contains more than one sheet, you will be prompted to select the desired sheet when the program is run.
The Data Transfer function is also available from the TAP menu:
A form is displayed to select the Source and Target files:
Copyright 2011 by SoftWright LLC