I am working on a data integration project and am trying to single out feature classes which have a schema that varies from two base feature classes (one for point, one for polyline features).
I've played around with the Feature Compare tool to compare schemas, but find it tedious to use this tool, even in batch mode, because it outputs a single text file with a few values for each comparison performed.
I started writing a script in Python to loop through a list of features in a list and compare their schema based on geometry type. However, the problem of either integrating the output into a single text file persists. Is there a way to obtain this value and append it to an existing text file?
(Messy) code so far as follows:
# Import arcpy module import arcpy # Import environments; set workspace from arcpy import env # Set workspace env.workspace = "Data_Comparison.gdb" # List features to be compared fclist = arcpy.ListFeatureClasses() print fclist # Loop through list to separate point and line feature classes for fc in fclist: desc = arcpy.Describe(fc) name = desc.file geo = desc.shapeType print ("Feature name: " + name) print ("Feature geometry: " + geo) if geo == "Point": arcpy.FeatureCompare_management("swr_net_nodal", fc, "ENTID", "SCHEMA_ONLY", "", "", "", "", "", "", "CONTINUE_COMPARE", "fc + '_compare'") output = arcpy.GetMessages() print output