サマリー
Converts a table to a CSV file.
使用法
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.
構文
ConvertTableToCsvFile_locref (in_table, out_csv_file, {in_delimiter})
パラメーター | 説明 | データ タイプ |
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,...] (オプション) | Sets the delimiter for the output CSV file (optional). The pipe delimiter is the default choice.
| String |
コードのサンプル
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.
# Requires: Esri Roads and Highways Solution
# 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")
環境
ライセンス情報
- ArcGIS Desktop Basic: 次のものが必要 Roads and Highways
- ArcGIS Desktop Standard: 次のものが必要 Roads and Highways
- ArcGIS Desktop Advanced: 次のものが必要 Roads and Highways