Importing shapefiles into Geodatabase DATASET with arcpy

2654
1
03-05-2011 05:40 PM
BruceGreen
New Contributor III
Hi guys
I am trying to import some shapefiles into the DATASET of a personal Geodatabase using arcpy at ArcMap 10.
I use this code
fcList = arcpy.ListFeatureClasses()
 
# Execute CopyFeatures for each input shapefile
for shapefile in fcList:
    # Determine the new output feature class path and name
    outFeatureClass = os.path.join(outWorkspace, shapefile.strip(".shp"))
    arcpy.CopyFeatures_management(shapefile, outFeatureClass)

which adds shapefiles as *.lyr into the GEODATABASE successfully but I want to import(Add) them into a specific dataset( for example schools.accd) in the Geodatabase .
Can you give me an idea how I can do it in ArcMap 10 using an stand alone pythin script?

Thanks
0 Kudos
1 Reply
ModyBuchbinder
Esri Regular Contributor
Hi Behrouz

Just add the dataset name to the output path.
Something like this:  os.path + "\\"  + outWorkspace + "\\datasetname\\" +  shapefile.strip(".shp")

Have Fun
Mody
0 Kudos