I have zero experience with python but am trying to search for broken hyperlinks in a large gdb (temporarily converted to a shapefile)-
Used code from a previous question (Using ArcPy to verify paths of Hyperlinks?) and adapted it to fit my problem (didn't know if I could ask a new question on that post...)
import arcpy
import os
fc = r"G:\GISDATA\misc\project_arcpy.shp"
fields = ["PROJECT_DW"]
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:\Users\GIS\Documents\brokenlinks.txt","a")
f.write(Roll + os.linesep)
f.close()
Instead of writing broken hyperlinks to my text file, it writes all they hyperlinks to the file.
lang-py
arcpy.Exists()
to see if that location exists.