Created
March 20, 2014 13:05
-
-
Save rabbleNaut/9663326 to your computer and use it in GitHub Desktop.
Uses Arcpy to iterate through feature classes in a feature dataset and rename them.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
from arcpy import * | |
env.workspace = r"C:\Users\RABBEY-C\RA_GIS\Projects\RA_EMST\Updated_Phase_Features.gdb\District_Unions" | |
fcList = arcpy.ListFeatureClasses() | |
#Renames featureclasses ending in "_Union" with "" | |
for fc in fcList: | |
Rename_management(fc, fc.replace('_Union','')) |
i have multiple datasets with multiple featureclasses . how can i loop through each dataset and perfome clip analysis on each dataset at the same time?
Name: Rename_Example2.py
Description: Rename fileGDB feature class
Import system modules
import arcpy
from arcpy import env
Set workspace
arcpy.env.workspace = "Folder Path of File Geodatabase"
wks = arcpy.ListWorkspaces('Name of the File Geodatabase to Select*','FileGDB')
print(wks)
for fgdb in wks:
arcpy.env.workspace = fgdb
fdta = arcpy.ListDatasets("*", "Feature")
print(fdta)
for dset in fdta:
for fc in arcpy.ListFeatureClasses(feature_dataset=dset):
print(fc)
arcpy.Rename_management(fc, fc+"_1",'FeatureClass')
print("Rename Complete")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i have multiple datasets with multiple featureclasses . how can i loop through each dataset and perfome clip analysis on each dataset at the same time?