文本文件属性 (arcpy)

摘要

如果文本文件包含表格数据,Describe 函数会返回文本文件的表属性数据集属性,否则会参考文件属性

文本文件可返回“TextFile”dataType

代码实例

Text File properties example (stand-alone script)

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
9/15/2013