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 arcpy import os fc = 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) if os.path.exists(Roll): pass else: f = open(r"C:\Scans\BrokenLinks.txt","a") f.write(Roll + os.linesep) f.close()