Using ArcPy to verify paths of Hyperlinks?

المشرف العام

Administrator
طاقم الإدارة
I've recently come across an issue where some of our hyperlinks aren't working.I'm familiar with python and have made similar scripts before, but I would first like to ask for your assistance to maybe something already pre-existing or another tool to use.

I would like to cycle through all the hyperlink paths for a certain shapefile and search the C:\Scans\ for the path.If the path doesn't exist than I want the path to be written to an excel file.

Can anyone help me with this?

Final code so far

import arcpyimport osfc = r"G:\GIS\Lauren\Shapes\watermains.shp"fields = ["Truck_Path"]with arcpy.da.SearchCursor (fc,fields) as cursor: for row in cursor: Roll = str(row[0]) if os.path.exists(Roll): pass else: f = open(r"C:\Scans\BrokenLinks.txt","a") f.write(Roll + os.linesep) f.close()

أكثر...
 
أعلى