CurrentDate = "20130625" OutName = "tempgdb.gdb" InSpreadsheet = "G:\Documents\GIS\HydstraData\HydstraMeasurementsDeep\HydstraMeasurements_" + CurrentDate + ".XLS" arcpy.ExcelToTable_conversion(InSpreadsheet,OutName)
Solved! Go to Solution.
# Set the workspace.
env.workspace = "G:\Documents\GIS\HydstraData"
arcpy.env.overwriteOutput = True
## Set the Spatial Reference.
Spatial_Reference = "PROJCS['NAD_1983_California_Teale_Albers',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Albers'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',-4000000.0],PARAMETER['Central_Meridian',-120.0],PARAMETER['Standard_Parallel_1',34.0],PARAMETER['Standard_Parallel_2',40.5],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]"
OutFolderPath = env.workspace
OutName = "tempgdb.gdb"
##Check if geodatabase exists.
if arcpy.Exists(OutName):
##Delete geodatabase.
arcpy.Delete_management(OutName)
##Create geodatabase.
arcpy.CreateFileGDB_management(OutFolderPath,OutName)
DateStart = date(2013,6,25)
DateEnd = date(2013,6,26)
for dt in rrule(DAILY, dtstart=DateStart, until=DateEnd):
CurrentDate = dt.strftime("%Y%m%d")
print CurrentDate
##Create Point Shapefile from spreadsheet.
InSpreadsheet = "G:\Documents\GIS\HydstraData\HydstraMeasurementsDeep\HydstraMeasurements_" + CurrentDate + ".XLS"
X_Coords = "Longitude"
Y_Coords = "Latitude"
Z_Coords = "MeanData"
Out_Layer = "Data_" + CurrentDate
OutTableName = os.path.join(OutFolderPath,OutName,"Data_" + CurrentDate)
print OutTableName
arcpy.ExcelToTable_conversion(InSpreadsheet,OutTableName)
print "Completed."