Skip to content

Instantly share code, notes, and snippets.

@MarketaP
Last active September 2, 2018 22:23
Show Gist options
  • Save MarketaP/af835c17063d094a90a0658508ed260f to your computer and use it in GitHub Desktop.
Save MarketaP/af835c17063d094a90a0658508ed260f to your computer and use it in GitHub Desktop.
in_table = 'C:\Users\mpodebradska2\Documents\ArcGIS\Thesis_New\Table.dbf'
field_names = ['Plan_Name', 'Plan_Nam_1', 'Plan_Nam_2', 'Plan_Nam_3']
all_values = []
with arcpy.da.SearchCursor(in_table,field_names) as cursor:
for row in cursor:
all_values.extend(list(row))
unique_values = set(all_values)
print unique_values
file = open("Table.txt","w")
file.write("\n ".join(unique_values))
file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment