<?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: arcpy.da.Walk to not read excel worksheets in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253291#M19514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Amy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you tried os.path.exists() instead of arpcy.exists(). This should work way faster &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 09:12:37 GMT</pubDate>
    <dc:creator>AlexanderWinz</dc:creator>
    <dc:date>2016-06-16T09:12:37Z</dc:date>
    <item>
      <title>arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253283#M19506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My walk code will not skip reading the worksheets inside excel files. Staff have excel files with a huge amount of worksheets that is slowing my walk down so that it is basically unusable. I think it is still reading the excel worksheets in the else statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, traceback, sys
arcpy.env.overwriteOutput = True
workspace = r"C:\Users\Documents\GisData"
arcpy.env.workspace = workspace
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; walk = arcpy.da.Walk(workspace)
&amp;nbsp;&amp;nbsp;&amp;nbsp; txt = open(r"C:\Users\Documents\StaffGISLibrary.txt", 'w')
&amp;nbsp;&amp;nbsp;&amp;nbsp; for dirpath, dirnames, filenames in walk:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(dirpath):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #describe = arcpy.Describe(dirpath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dirpath.endswith(('.xls', '.xlsx', '.txt')):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "skipping excel file"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fullpath = os.path.join(dirpath, filename)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; describe = arcpy.Describe(fullpath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "writing " + fullpath
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txt.write(fullpath + "," + filename + "," + describe.dataType + "\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "DOES NOT EXIST"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; del filename, dirpath, dirnames, filenames
&amp;nbsp;&amp;nbsp;&amp;nbsp; txt.close() 
except Exception, e:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred, print line number and error message
&amp;nbsp;&amp;nbsp;&amp;nbsp; import traceback, sys
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = sys.exc_info()[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Line %i" % tb.tb_lineno
&amp;nbsp;&amp;nbsp;&amp;nbsp; print e.message
finally:
&amp;nbsp;&amp;nbsp;&amp;nbsp; raw_input("Finished!")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253283#M19506</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T12:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253284#M19507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just a hunch, shouldn't it be the filenames that you are looking for the xls extensions not the dirpath?&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/walk.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/walk.htm"&gt;Walk—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:22:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253284#M19507</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-15T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253285#M19508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;filenames goes into the worksheets themselves, was trying to avoid that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253285#M19508</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2016-06-15T21:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253286#M19509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would throw in some print statements then, or use os.path to exclude excel files, although they should essentially work the same&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253286#M19509</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-15T21:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253287#M19510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got to where I am by using print statements. the code works perfectly until I add in one of the large excel files (large amount of worksheets and records). it's not printing the excel files but it's still reading them in the else statement because my cursor stalls. Hope that makes sense. It's like dirpath or filenames is being pulled from the first part of the code before I excluded the excel files in the else statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:35:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253287#M19510</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2016-06-15T21:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253288#M19511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dirpath&amp;nbsp; isn't that the directory path&lt;/P&gt;&lt;P&gt;I would have put the excel check in the filename section or exclude it as a data type in the datatype section or provide an inclusion list of files you wish to examine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:31:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253288#M19511</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-15T22:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253289#M19512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for wasting everyone's time. it was just slow and I assumed it was stalling. guess I need to be more patient.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:34:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253289#M19512</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2016-06-15T22:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253290#M19513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I originally had it in the filename section but it had to go in and read all the worksheets. when I changed that it worked much faster. I like the inclusion idea but not sure how to do that with file geodatabases and the feature classes within.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose I would need to run a "list" this or that................&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253290#M19513</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2016-06-15T22:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253291#M19514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Amy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you tried os.path.exists() instead of arpcy.exists(). This should work way faster &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 09:12:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253291#M19514</guid>
      <dc:creator>AlexanderWinz</dc:creator>
      <dc:date>2016-06-16T09:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253292#M19515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I am going to move over to os.walk too, arcpy.da.walk errors "does not exist" for too many files, over 50 percent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the tip for the os.path.exists()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 15:23:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253292#M19515</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2016-06-16T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253293#M19516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simplest fix is changing line 13 from &lt;SPAN style="font-family: courier new,courier;"&gt;pass&lt;/SPAN&gt; to &lt;SPAN style="font-family: courier new,courier;"&gt;continue&lt;/SPAN&gt;.&amp;nbsp; You are using the wrong control flow statement.&amp;nbsp; See &lt;A href="https://docs.python.org/2.7/tutorial/controlflow.html"&gt;More Control Flow Tools&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 16:01:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253293#M19516</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-06-16T16:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253294#M19517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried it with continue too, same result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 16:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253294#M19517</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2016-06-16T16:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253295#M19518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would this print statement not work? (EOF error when using "\")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for dirpath, dirnames, filenames in walk:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for d in dirnames:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in filenames:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print dirpath + d + "\" + f
&amp;nbsp;&amp;nbsp;&amp;nbsp; del d, f, dirpath, dirnames, filenames&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253295#M19518</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T12:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253296#M19519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was hoping the "simplest" fix would work.&amp;nbsp; After seeing your reply and thinking about it, I realized why it doesn't work, or at least why your code is still slowing down when coming across Excel files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/walk.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcPy Data Access Walk &lt;/A&gt;documentation states, the standard method of forgoing a subworkspace is to modify the directory names list in place before the function starts stepping down into them.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;When topdown is True, the dirnames list can be modified in-place, and Walk() will only recurse into the subworkspaces whose names remain in dirnames. This can be used to limit the search, impose a specific order of visiting, or even to inform Walk() about directories the caller creates or renames before it resumes Walk() again. Modifying dirnames when topdown is Falseis ineffective, because in bottom-up mode the workspaces in dirnames are generated before dirpath itself is generated.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Something along the lines of:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; walk = arcpy.da.Walk(workspace)
&amp;gt;&amp;gt;&amp;gt; for dirpath, dirnames, filenames in walk:
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for dir in dirnames[:]:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dir.endswith(('.xls', '.xlsx', '.txt')):
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dirnames.remove(dir)
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames:
....&lt;/PRE&gt;&lt;P&gt;Make sure to iterate over a copy of &lt;SPAN style="font-family: courier new,courier;"&gt;dirnames&lt;/SPAN&gt; (as done by &lt;SPAN style="font-family: courier new,courier;"&gt;dirnames[:]&lt;/SPAN&gt; ) or modifying the list in place won't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:32:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253296#M19519</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T12:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Walk to not read excel worksheets</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253297#M19520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Backslashes are escape characters in Python.&amp;nbsp; Since you aren't escaping the escape character, you are likely creating a special character with one of your file names and causing an issue.&amp;nbsp; The safer approach when building file system paths is to use Python's &lt;A href="https://docs.python.org/2/library/os.html"&gt;os.path &lt;/A&gt;functionality.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 17:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-walk-to-not-read-excel-worksheets/m-p/253297#M19520</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-06-16T17:13:46Z</dc:date>
    </item>
  </channel>
</rss>

