I'm specifically referring to the output of the Compare Table (Data Management) tool, which is a comma delimited text file.
When you add the text file manually, you can actually view it like any other table, by selecting "View Attribute Table," even though it's a just text file.
Previously, I've written code that adds the output of other tools to the map document, but these have always been feature class outputs, not text file outputs. Here's how I've added feature class outputs to an mxd in the past:
mxd = arcpy.mapping.MapDocument("CURRENT")df = arcpy.mapping.ListDataFrames(mxd)[0]fc = pathToMyFeatureClassarcpy.MakeFeatureLayer_management(fc, "fc_lyr")addLayer = arcpy.mapping.Layer("fc_lyr")arcpy.mapping.AddLayer(df, addLayer)So I'm looking for something similar for the text file, and I'm not finding anything. Seems simple enough. I thought maybe something like arcpy.MakeTableView_management() might do the trick, but when I added that to my code, I got an error that my parameters were invalid, that the output of my Compare Table tool did not exist or is not supported, and since I know the output exists, then it must not be supported.
Any help would be appreciated!
أكثر...
When you add the text file manually, you can actually view it like any other table, by selecting "View Attribute Table," even though it's a just text file.
Previously, I've written code that adds the output of other tools to the map document, but these have always been feature class outputs, not text file outputs. Here's how I've added feature class outputs to an mxd in the past:
mxd = arcpy.mapping.MapDocument("CURRENT")df = arcpy.mapping.ListDataFrames(mxd)[0]fc = pathToMyFeatureClassarcpy.MakeFeatureLayer_management(fc, "fc_lyr")addLayer = arcpy.mapping.Layer("fc_lyr")arcpy.mapping.AddLayer(df, addLayer)So I'm looking for something similar for the text file, and I'm not finding anything. Seems simple enough. I thought maybe something like arcpy.MakeTableView_management() might do the trick, but when I added that to my code, I got an error that my parameters were invalid, that the output of my Compare Table tool did not exist or is not supported, and since I know the output exists, then it must not be supported.
Any help would be appreciated!
أكثر...