ParseFieldName (arcpy)

サマリ

Parses a fully qualified field name into its components (database, owner name, table name, and field name) depending on the workspace. ParseFieldName returns a string containing the parsed table name, containing the database, owner, table, and field names separated by commas. The workspace must be a personal, file, or ArcSDE geodatabase.

構文

ParseFieldName (name, {workspace})
パラメータ説明データ タイプ
name

The field name to be parsed.

String
workspace

Specifies the workspace for fully qualifying the field name. The workspace must be a personal, file, or ArcSDE geodatabase.

String
戻り値
データ タイプ説明
String

Returns the field name parsed into its components (database name, owner name, table name, field name) separated by commas.

コードのサンプル

ParseFieldName example

Parse a field name into its components.

import arcpy

field_name = arcpy.GetParameterAsText(0)
workspace = arcpy.GetParameterAsText(1)

# Parse the field name into database, owner, table and field
fullname = arcpy.ParseFieldName(field_name, workspace)
database, owner, table, field = fullname.split(", ")

関連トピック

4/26/2014