You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want read n update existing metadata replacing some value from external csv file based on fc name as common id between Featureclasses and csv file(3 columns). but whenever I use dict in my code. it is throwing error
import arcpy_metadata as md
import datetime
import arcpy
import os
workspace ='C:\xxx\AssetID_to_Shapefile_Script_Output_V1'
csvpath=r"C:\xxx\test_metadata\test\meta_batch14.csv"
d = {}
with open(csvpath) as f:
for line in f:
(key, AccesWidth,drwgNo) = line.split(',')
d[(key)] = AccesWidth #EaseWidth
print d
walk = arcpy.da.Walk(workspace, datatype="FeatureClass")
for dirpath, dirnames, filenames in walk:
for filename in filenames:
fc=(os.path.join(dirpath, filename))
metadata = md.MetadataEditor(fc)
print (fun_csvtodict(csvpath))
fcname=filename[:-4]
print fcname+'\n' +'\t'+ metadata.abstract
metadata.finish()
print "~~~~~~~~~~~~~~~~~~~~~~~Finished~~~~~~~~~~~~~~~~~"
NameError: name 'metadata' is not defined
The text was updated successfully, but these errors were encountered:
I want read n update existing metadata replacing some value from external csv file based on fc name as common id between Featureclasses and csv file(3 columns). but whenever I use
dict
in my code. it is throwing errorThe text was updated successfully, but these errors were encountered: