Text File properties

This ArcGIS 3.0 documentation has been archived and is no longer updated. Content and links may be outdated. See the latest documentation.

Summary

If the text file contains tabular data, the Describe function returns the Table and Dataset property groups for text files; otherwise, refer to the File property group.

For a text file, the Describe dataType property returns a value of "TextFile".

Code sample

Text file properties example

The following stand-alone script displays some text file properties for a text file that has tabular data:

import arcpy

# Create a Describe object from the text file.
#
desc = arcpy.Describe("C:/data/evac_table.txt")

# Print some table properties
#
print("HasOID: " + str(desc.hasOID))

print("\nField names:")
for field in desc.fields:
    print("   " + field.name)

In this topic