import arcpy
import sys
import string
import os
tablePath = arcpy.GetParameterAsText(0)
filePath = arcpy.GetParameterAsText(1)
outfile = open(filePath, "w")
fields = arcpy.ListFields(tablePath)
fieldNames = []
for field in fields:
if (field.type <> "Geometry" and field.type <> "BLOB"):
fieldNames.append(field.name)
outfile.write("
outfile.write("
\n")for fieldName in fieldNames:
outfile.write("
" + fieldName + "\n")outfile.write("
\n")for row in arcpy.da.SearchCursor(tablePath, fieldNames):
outfile.write("
\n")for value in row:
outfile.write(u"
" + str(value) + "\n")outfile.write("
\n")outfile.write("
\n")outfile.flush()
outfile.close()
标签:field,outfile,python,fieldNames,write,arcgis,html,import,arcpy
来源: https://www.cnblogs.com/gisoracle/p/11396181.html