AnsweredAssumed Answered

ListFeatureClasses python script truncating features

Question asked by JB4Pres on Oct 8, 2014
Latest reply on Oct 9, 2014 by JB4Pres

I found an arcpy script for exporting all feature classes within a geodatabase, however, it is truncating the names to 26 character max. Features can be up to 160 characters, though the most I have is maybe 40 ... thanks end users. How do I get the full name out of the database.






import arcpy  
# create or open an existing text file  
f = open("c:\\temp\\fc_list.txt", "a")  
# specify the geodatabase you want to retrieve feature classes from  
gdb = "c:\\temp\\Tracks.gdb"  
# set your environment workspace  
arcpy.env.workspace = gdb  
#list all of the feature datasets within the geodatabase  
datasetList = arcpy.ListDatasets("*")  
# within each feature dataset, list the feature classes and write them to the text file  
for dataset in datasetList:  
 fcList1 = arcpy.ListFeatureClasses("*","",dataset)  
 for fc in fcList1:  
  f.write(fc + "\n")  
# find all of the feature classes which do not reside within a feature dataset  
fcList2 = arcpy.ListFeatureClasses("*")  
# write the feature class names to the text file which don't reside in the feature dataset  
for fc in fcList2:  
 f.write(fc + "\n")