Shapefiles
Above mentioned is the link for the sample folder of shapefiles. I am working on exactly opposite of Export File Geodatabase to Folder of shapefiles
I have a multiple folder of shapefiles with several shapefiles in each folder. I want to create a geodatabase where the name of feature datasets name should resemble the name of the folders respectively. The shapefiles in each folder should get exported as a Feature classes in Feature dataset. Each feature class name should resemble the shapefile names respectively.
import arcpyimport osShapefilesDirectory = r"I:\python\SampleData\Shapefiles"arcpy.CreateFileGDB_management("I:/python/SampleData", "Shapefiles.gdb")arcpy.env.workspace = ShapefilesDirectoryprint "Building List of Folder of Shapefiles..."fldList = arcpy.ListWorkspaces('*','Folder')if len(fldList) == 0: print "No folders with shapefiles found"else: for fld in fldList: print fld arcpy.CreateFeatureDataset_management("I:/python/SampleData/Shapefiles.gdb", fld, "I:/python/MultipleFD2GDB/2229.prj") if os.path.exists(Shapefiles.gdb + "\\" + fld) == False: print "Creating " + fld + " Directory..." arcpy.CreateFolder_management(Shapefiles.gdb + "\\" + fld)After this I am getting an error which are as follows:
"Runtime error Traceback (most recent call last): File "", line 14, in File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 14785, in CreateFeatureDataset raise e ExecuteError: ERROR 999999: Error executing function. Failed to execute (CreateFeatureDataset). "
أكثر...
Above mentioned is the link for the sample folder of shapefiles. I am working on exactly opposite of Export File Geodatabase to Folder of shapefiles
I have a multiple folder of shapefiles with several shapefiles in each folder. I want to create a geodatabase where the name of feature datasets name should resemble the name of the folders respectively. The shapefiles in each folder should get exported as a Feature classes in Feature dataset. Each feature class name should resemble the shapefile names respectively.
import arcpyimport osShapefilesDirectory = r"I:\python\SampleData\Shapefiles"arcpy.CreateFileGDB_management("I:/python/SampleData", "Shapefiles.gdb")arcpy.env.workspace = ShapefilesDirectoryprint "Building List of Folder of Shapefiles..."fldList = arcpy.ListWorkspaces('*','Folder')if len(fldList) == 0: print "No folders with shapefiles found"else: for fld in fldList: print fld arcpy.CreateFeatureDataset_management("I:/python/SampleData/Shapefiles.gdb", fld, "I:/python/MultipleFD2GDB/2229.prj") if os.path.exists(Shapefiles.gdb + "\\" + fld) == False: print "Creating " + fld + " Directory..." arcpy.CreateFolder_management(Shapefiles.gdb + "\\" + fld)After this I am getting an error which are as follows:
"Runtime error Traceback (most recent call last): File "", line 14, in File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 14785, in CreateFeatureDataset raise e ExecuteError: ERROR 999999: Error executing function. Failed to execute (CreateFeatureDataset). "
أكثر...