ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

Excel → テーブル (Excel To Table)

  • 概要
  • 使用法
  • 構文
  • コードのサンプル
  • 環境
  • ライセンス情報

概要

Microsoft Excel ファイルをテーブルに変換します。

使用法

  • [Excel → テーブル (Excel To Table)] は、Excel Workbook (*.xlsx) および Microsoft Excel 5.0/95 Workbook (*.xls) フォーマットを入力としてサポートしています。

  • このツールは、表データが縦に並べられていることを前提としています。先頭行は、出力テーブルのフィールド名とみなされます。これらのフィールド名は、エラーが起きたり名前が重複しないよう検証プロセス中に名前を変更できます。データとデータの間に空の列がある場合、それらは維持され、汎用的なフィールド名 (たとえば、field_4) が付与されます。

  • 出力フィールドのデータ タイプは、入力列内にあった値とセルの書式設定に基づきます。出力フィールドのデータ タイプには、浮動小数点、テキスト、日付などがあります。入力列に複数のデータまたは書式設定のタイプがある場合、出力フィールドのタイプはテキストになります。

構文

arcpy.conversion.ExcelToTable(Input_Excel_File, Output_Table, {Sheet})
パラメーター説明データ タイプ
Input_Excel_File

変換する Microsoft Excel。

File
Output_Table

出力テーブル。

Table
Sheet
(オプション)

インポートする Excel ファイル内の特定のシートの名前。指定しない場合、ワークブックの最初のシートが使用されます。

String

コードのサンプル

ExcelToTable (Excel → テーブル) の例 (Python ウィンドウ)

次の Python ウィンドウ スクリプトは、イミディエイト モードで ExcelToTable (Excel → テーブル) 関数を使用する方法を示しています。

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.ExcelToTable_conversion("data.xls", "outgdb.gdb", "Sheet1")
ExcelToTable (Excel → テーブル) の例 2 (スタンドアロン スクリプト)

Microsoft Excel ファイルの各シートを、ジオデータベースの各テーブルにインポートします。

import os
import xlrd
import arcpy
def importallsheets(in_excel, out_gdb):
    workbook = xlrd.open_workbook(in_excel)
    sheets = [sheet.name for sheet in workbook.sheets()]
    print('{} sheets found: {}'.format(len(sheets), ','.join(sheets)))
    for sheet in sheets:
        # The out_table is based on the input excel file name
        # a underscore (_) separator followed by the sheet name
        out_table = os.path.join(
            out_gdb,
            arcpy.ValidateTableName(
                "{0}_{1}".format(os.path.basename(in_excel), sheet),
                out_gdb))
        print('Converting {} to {}'.format(sheet, out_table))
        # Perform the conversion
        arcpy.ExcelToTable_conversion(in_excel, out_table, sheet)
if __name__ == '__main__':
    importallsheets('c:/data/data.xls',
                    'c:/data/outgdb.gdb')

環境

  • 現在のワークスペース
  • テンポラリ ワークスペース
  • 出力データのコンフィグレーション キーワード

ライセンス情報

  • Basic: はい
  • Standard: はい
  • Advanced: はい

関連トピック

  • Excel ツールセットの概要
  • テーブル → Excel (Table To Excel)

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS

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

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2021 Esri. | プライバシー | リーガル