Table to dBASE (Conversion)
Summary
Converts one or more tables to dBASE tables in an output folder.
Usage
-
This tool supports the following table formats as input:
- dBASE (.dbf)
- Comma Separate Value (.csv)
- tab delimited text (.txt)
- Microsoft Excel worksheets (.xls or .xlsx)
- INFO
- VPF
- OLE database
- personal, file, or SDE geodatabase
- in-memory table views
For file input (.csv or .txt), the first row of the input file is used as the field names on the output table. Field names cannot contain spaces or special characters (such as $ or *), and you will receive an error if the first row of input file contains spaces or special characters.
-
The name of the output dBASE tables will be based on the name of the input table. To control the output name and for additional conversion options use the Table to Table tool.
This tool can be used to export an ArcGIS table to a dBASE table (.dbf) that can be read and edited in Microsoft Excel.
-
The Copy Rows and Table To Table tools can also be used to convert a table to a dBASE file.
-
If the name of the output table already exists in the output folder, a number will be appended to the end of the name to make it unique (for example, OutputTbl_1.dbf).
Syntax
Parameter | Explanation | Data Type |
input_table [input_table,...] |
The list of tables to be converted to dBASE. | Table View |
output_folder |
The destination folder where the output dBASE table(s) will be placed. | Folder |
Code Sample
The following Python window script demonstrates how to use the TableToDBASE function in immediate mode.
import arcpy from arcpy import env env.workspace = "C:/data/Habitat_Analysis.gdb" arcpy.TableToDBASE_conversion(["vegtype", "futrds"], "C:/output")
The following stand-alone script demonstrates how to use the TableToDBASE function.
# Name: TableToDBASE_Example2.py # Description: Use TableToDBASE to copy tables to dBASE format # Author: ESRI # Import system modules import arcpy from arcpy import env # Set environment settings env.workspace = "C:/data" # Set local variables inTables = ["vegtype", "futrds"] outLocation = "C:/output" try: # Execute TableToDBASE arcpy.TableToDBASE_conversion(inTables, outLocation) except: print arcpy.GetMessages()