GeoProcessor / Command / ReadTableFromExcel
Overview
The ReadTableFromExcel
command reads a Table from an Excel file.
- The Excel worksheet to read can be specified.
- All rows and columns from the Excel worksheet are read into the Table.
Command Editor
The following dialog is used to edit the command and illustrates the command syntax.
ReadTableFromExcel
Command Editor (see full-size image)
Command Syntax
The command syntax is as follows:
ReadTableFromExcel(Parameter="Value",...)
Command Parameters
Parameter | Description | Default |
---|---|---|
InputFile required |
The Excel workbook file (.xls or .xlsx ) with the Excel worksheet to read (relative or absolute path). ${Property} syntax is recognized. |
None - must be specified. |
Worksheet |
The name of the Excel worksheet within the Excel workbook to read. | The first worksheet in the Excel workbook. |
TableID |
A Table identifier. Refer to documentation for best practices for naming Table identifiers. | The Worksheet . |
IfTableIDExists |
The action that occurs if the TableID already exists within the GeoProcessor:
|
Replace |
Examples
See the automated tests.
The following folder, ExampleFolder
, and its contents are used for the examples.
The ExampleFolder
is not an actual existing folder.
It is used in this documentation to explain how the ReadTableFromExcel
command interacts with similar, existing folders on your local machine.
ExampleFolder
Filename | File Type |
---|---|
ExampleFile1.xlsx | Excel Workbook |
ExampleFile1 Excel Workbook
Sheet Name |
---|
Clients |
Products |
Example 1: Read a Table from the first Worksheet of an Excel File
ReadTableFromExcel(InputFile = "ExampleFolder/ExampleFile1.xlsx")
After running the command, the following Table IDs are registered within the GeoProcessor.
Registered Table IDs |
---|
Clients |
Example 2: Assign a Unique Table ID
ReadTableFromExcel(InputFile = "ExampleFolder/ExampleFile1.geojson", TableID = "Client-Table")
After running the command, the following Table IDs are registered within the GeoProcessor.
Registered Table IDs |
---|
Client-Table |
Example 3: Read a Table from a Specific Worksheet of an Excel File
ReadTableFromExcel(InputFile = "ExampleFolder/ExampleFile1.geojson", Worksheet="Products")
After running the command, the following Table IDs are registered within the GeoProcessor.
Registered Table IDs |
---|
Products |
Troubleshooting
See Also
- The Tables are read using the
Pandas Python library
. WriteTableToExcel
command