<?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: Export ListLayer to CSV or Excel in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/export-listlayer-to-csv-or-excel/m-p/713407#M55334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, sys, traceback

mxd = arcpy.mapping.MapDocument(r"G:\WIU\projects\Emerald_ash_borer\dispersal.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]

f = open(r"G:\WIU\projects\Emerald_ash_borer\Layer_list.csv", "w")
f.write("Layers\n")
for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write("%s\n" %lyr)
f.close()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 06:33:44 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T06:33:44Z</dc:date>
    <item>
      <title>Export ListLayer to CSV or Excel</title>
      <link>https://community.esri.com/t5/python-questions/export-listlayer-to-csv-or-excel/m-p/713406#M55333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any python script to list all the layers within a mxd (ListLayer function) and export the list to a CSV file?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 01:08:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-listlayer-to-csv-or-excel/m-p/713406#M55333</guid>
      <dc:creator>RaziMosadeghi</dc:creator>
      <dc:date>2012-12-04T01:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Export ListLayer to CSV or Excel</title>
      <link>https://community.esri.com/t5/python-questions/export-listlayer-to-csv-or-excel/m-p/713407#M55334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, sys, traceback

mxd = arcpy.mapping.MapDocument(r"G:\WIU\projects\Emerald_ash_borer\dispersal.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]

f = open(r"G:\WIU\projects\Emerald_ash_borer\Layer_list.csv", "w")
f.write("Layers\n")
for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write("%s\n" %lyr)
f.close()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-listlayer-to-csv-or-excel/m-p/713407#M55334</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T06:33:44Z</dc:date>
    </item>
  </channel>
</rss>

