ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

Convert Table To CSV File

  • Resumen
  • Uso
  • Sintaxis
  • Muestra de código
  • Entornos
  • Información de licenciamiento

Resumen

Converts a table to a CSV file.

Uso

  • The input file can be a geodatabase table, feature class, shape file, .dbf file, or table view.

  • The output CSV file has the option to be pipe or comma delimited.

Sintaxis

arcpy.locref.ConvertTableToCsvFile(in_table, out_csv_file, {in_delimiter})
ParámetroExplicaciónTipo de datos
in_table

A geodatabase table, feature class, shapefile, .dbf file, or table view to convert.

Table View
out_csv_file

Location and file name of the output CSV file.

file
in_delimiter
[in_delimiter,...]
(Opcional)

Sets the delimiter for the output CSV file (optional). The pipe delimiter is the default choice.

  • PIPE —The fields are separated by a pipe, for example, Field1 | Field2. This is the default.
  • COMMA —The fields are separated by a comma, for example, Field1, Field2.
String

Muestra de código

ConvertTableToCsvFile example 1 (Python window)

The following Python window script demonstrates how to use the ConvertTableToCsvFile function in the immediate mode.

# tool variables
in_table = "SpeedLimit"
out_csv_file = "SpeedLimit_Converted"
in_delimiter = "COMMA"

# set current workspace
arcpy.env.workspace = "C:/Transportation.gdb"

# Process: Convert Table To CSV File
arcpy.ConvertTableToCsvFile_locref(in_table, out_csv_file, in_delimiter)
ConvertTableToCsvFile example 2 (stand-alone script)

The following Python window script demonstrates how to use the ConvertTableToCsvFile function in a stand-alone python script.

# Name: TableToCSV.py
# Description: Converts a table to a CSV file. 

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("Highways")

# Process: Convert Table To CSV File
arcpy.ConvertTableToCsvFile_locref(r"C:\Transportation.gdb\SpeedLimit", r"C:\Data\SpeedLimit_Coverted", "COMMA")

Entornos

  • Espacio de trabajo actual

Información de licenciamiento

  • Basic: Requiere Roads and Highways
  • Standard: Requiere Roads and Highways
  • Advanced: Requiere Roads and Highways

Temas relacionados

  • An overview of the Location Referencing toolbox

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2021 Esri. | Privacidad | Legal