ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Table To Table

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Converts an input table to a dBASE or geodatabase table.

Usage

  • This tool supports the following table formats as input:

    • Geodatabase
    • dBASE (.dbf)
    • Comma-separated values (.csv)
    • Tab-delimited text (.txt)
    • Microsoft Excel worksheets (.xls or .xlsx)
    • INFO
    • VPF
    • OLE database
    • 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 the input file contains spaces or special characters.

    Learn more about table formats supported in ArcGIS

  • This tool can convert input tables to dBASE (.dbf), enterprise, workgroup, or desktop geodatabases, INFO, and comma-separated values (.csv or .txt) tables.

  • The Field Map parameter controls how the input fields in the Input Features will be written to the Output Features.

    • To remove fields during processing, delete output fields from the Field Map. This will not affect the input.
    • The data type of an output field will default to the same as the data type of the first input field (of that name) it encounters. The data type may be changed manually at any time to any valid data type.
    • There are a number of Merge rules available: first, last, join, sum, mean, median, min, max, and standard deviation.
    • When using a merge rule of Join, you can specify your own delimiter such as a space, comma, period, dash, and so on. If you want to use a space, make sure your mouse pointer is at the start of the input box and click the space bar once.
    • You can specify the start and end positions of text fields using the format option.
    • Standard deviation should not be performed on a single input because values cannot be divided by zero, so standard deviation is not a valid option for single inputs.
      • Learn more about attribute field mapping
      • Learn more about mapping fields in scripts

  • When converting geodatabase data that has subtypes or domains to a dBASE table, both the subtype and domain codes and descriptions can be included in the output. Use the Transfer field domain descriptions geoprocessing environment to control this behavior. By default, only domain and subtype codes will be included in the output, not descriptions.

    Note:

    Conversion to dBASE (.dbf) table with subtype and domain descriptions may take more time (slower performance) than without descriptions. If you do not require the subtype and domain descriptions in your dBASE (.dbf) table output, it is recommended you use the unchecked (False or NOT_TRANSFER_DOMAINS in scripting) default behavior of the Transfer field domain descriptions environment to achieve best performance.

Syntax

TableToTable_conversion (in_rows, out_path, out_name, {where_clause}, {field_mapping}, {config_keyword})
ParameterExplanationData Type
in_rows

The input table to be converted to a new table.

Table View; Raster Layer
out_path

The destination where the output table will be written.

Workspace
out_name

The name of the output table.

If the output location is a folder, convert the input rows to a dBASE table by specifying a name with the extension .dbf, or convert the input rows to an INFO table by specifying a name with no extension. If the output location is a geodatabase, convert the input rows to a geodatabase table by specifying a name with no extension.

String
where_clause
(Optional)

An SQL expression used to select a subset of records. Learn more about SQL query expressions

SQL Expression
field_mapping
(Optional)

The fields and field contents chosen from the input table. You can add, rename, or delete output fields as well as set properties such as data type and merge rule.

Learn more about choosing and setting the output fields.

You can use the ArcPy FieldMappings object for this parameter.

Field Mappings
config_keyword
(Optional)

Specifies the default storage parameters (configurations) for geodatabases in a relational database management system (RDBMS). This setting is applicable only when using enterprise geodatabase tables.

Configuration keywords are set by the database administrator.

String

Code sample

TableToTable example 1 (Python window)

The following Python window script demonstrates how to use the TableToTable tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.TableToTable_conversion("vegtable.dbf", "C:/output/output.gdb", "vegtable")
TableToTable example 2 (stand-alone Python script)

The following stand-alone script demonstrates how to use the TableToTable tool.

# Name: TableToTable_Example2.py
# Description: Use TableToTable with an expression to create a subset
#  of the original table.
 
# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "C:/data"
 
# Set local variables
inTable = "vegtable.dbf"
outLocation = "C:/output/output.gdb"
outTable = "estuarine"

# Set the expression, with help from the AddFieldDelimiters function to select the appropriate field delimiters for the data type
expression = arcpy.AddFieldDelimiters(env.workspace, "VEG_TYPE") + " = 'Estuarine'"
 
# Execute TableToTable
arcpy.TableToTable_conversion(inTable, outLocation, outTable, expression)

Environments

  • Current Workspace
  • Output CONFIG Keyword
  • Scratch Workspace
  • Transfer Field Domain Descriptions
  • Extent
  • Qualified Field Names

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • About loading data into existing feature classes and tables
  • Copy Rows
  • Loading data in the Catalog tree
  • About loading data in ArcMap
  • A quick tour of the geodatabase
  • An overview of the To Geodatabase toolset

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal