<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hyperlinks and Field Calculator in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443541#M14921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like the target files are somewhere on your network (to wit: a letter mapped drive and not http)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runs a search cursor through the table, and pick up each path string in turn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pass that path string to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;os.path.exists(pathString) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and if the result is False, write the path (or the OID, or both) to a list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if not os.path.exists(pathString):
&amp;nbsp;&amp;nbsp;&amp;nbsp; brokeList.append(theOID)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:50:37 GMT</pubDate>
    <dc:creator>markdenil</dc:creator>
    <dc:date>2021-12-11T19:50:37Z</dc:date>
    <item>
      <title>Hyperlinks and Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443540#M14920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the field calculator to automatically populate a column of hyperlinks to pdf documents.&amp;nbsp; I have a folder with pdfs that are named the same as an existing field in my shape file.&amp;nbsp; Over 90% of my hyperlinks work but some do not for one of two reasons.....&amp;nbsp; There is not a pdf for that attribute or the pdf naming convention does not match the field name.&amp;nbsp; Is there a way to determine which hyperlinks are not working? I currently am clicking on each polygon using info to verify that the link is live.&amp;nbsp; If the link is dead I delete the link if I do not have a pdf or modify the link to point at the correct PDF.&amp;nbsp; Is there another way to automatically tell me which links are dead or possible an entirely different way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using Arc info 9.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My field Calculator statement is (This work fine): "N:\Reports\" &amp;amp; [Asbestos] &amp;amp; "AESC.pdf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 16:53:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443540#M14920</guid>
      <dc:creator>DanielErklauer</dc:creator>
      <dc:date>2012-05-01T16:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks and Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443541#M14921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like the target files are somewhere on your network (to wit: a letter mapped drive and not http)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runs a search cursor through the table, and pick up each path string in turn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pass that path string to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;os.path.exists(pathString) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and if the result is False, write the path (or the OID, or both) to a list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if not os.path.exists(pathString):
&amp;nbsp;&amp;nbsp;&amp;nbsp; brokeList.append(theOID)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:50:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443541#M14921</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2021-12-11T19:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks and Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443542#M14922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Mark&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what am I missing here to write the results to an text?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
import arcgisscripting


# Create the geoprocessor object

gp = arcgisscripting.create(9.3)

#Create search cursor 

shp = "C:\Dan\search_cursor.shp"

rows = gp.SearchCursor(shp)
row = rows.Next()
fields = gp.ListFields(shp)

if not os.path.exists(shp):
&amp;nbsp;&amp;nbsp;&amp;nbsp; brokeList.append(path,"demo.txt")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:50:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443542#M14922</guid>
      <dc:creator>DanielErklauer</dc:creator>
      <dc:date>2021-12-11T19:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks and Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443543#M14923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, append is a method of adding to a python list, not a file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You know the shp exists, you want to test the path in the record (which you never access)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this. It has no errorchecking, and you should replace "&amp;lt;&amp;lt;WHATEVER THE PATH FIELDNAME IS&amp;gt;&amp;gt;" with the field name of your field with the paths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import os import arcgisscripting&amp;nbsp; # Create the geoprocessor object gp = arcgisscripting.create(9.3)&amp;nbsp; shp = r"C:\Dan\search_cursor.shp" brokeList = []&amp;nbsp; # &amp;lt;- you need a list&amp;nbsp; #Create search cursor rows = gp.SearchCursor(shp) row = rows.Next() while row: &amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; grab the item values you are interested in &amp;nbsp;&amp;nbsp;&amp;nbsp; pathString = row.&amp;lt;&amp;lt;WHATEVER THE PATH FIELDNAME IS&amp;gt;&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; theFID = row.FID &amp;nbsp;&amp;nbsp;&amp;nbsp; # see if the link path is valid &amp;nbsp;&amp;nbsp;&amp;nbsp; if not os.path.exists(pathString): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; append the FID of bad links to the list &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; brokeList.append(theFID) &amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.Next()&amp;nbsp; if len(brokeList) &amp;gt; 0: print "Broken links found!"&amp;nbsp; # write the list to a file txt = open(r"C:\Dan\demo.txt", 'w') for broke in brokeList: &amp;nbsp;&amp;nbsp;&amp;nbsp; txt.write(str(broke) + "\n") txt.close() print 'DONE'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 14:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443543#M14923</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2012-05-02T14:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks and Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443544#M14924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark, thanks for your answer this was very helpfull.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 16:00:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/hyperlinks-and-field-calculator/m-p/443544#M14924</guid>
      <dc:creator>DanielErklauer</dc:creator>
      <dc:date>2012-05-02T16:00:15Z</dc:date>
    </item>
  </channel>
</rss>

