- Supports xlsx and xls file extensions
- First row is considered the field names, and can be renamed so a valid table is generated
- It assumes that each field contains uniform data types and the data is not mixed
ExcelToTable() takes the following inputs:
- Input_Excel_File - MS Office Excel file path
- Output_table - export table name and path
- Sheet (optional) - Name of the sheet to export. If none is provide the 1st sheet will be exported
Sample:
import arcpy from arcpy import env if __name__ == '__main__': env.overwriteOutput = True xls_file = r"c:\temp\somedata.xls" # supports xlsx and xls dest_gdb = env.scratchGDB arcpy.ExcelToTable_conversion(xls_file, os.path.join(dest_gdb, "sheet"))
Pretty easy. The biggest advantage I see with this tool is if you are in an environment where you cannot install 3rd party modules like xlrd.
Enjoy