<?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: Attribute Table to CSV in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125660#M4360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For this method just make a list of those fields and iterate over them to make your rows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the variable "header" would be ["ID", "x_1", "y_2", "i", "r", "height"].&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found a flaw with this though. Using the csv library is great if you are reading and writing a csv, but if you are only writing as is the case here, it is actually better to use the built in file object instead because the csv library cant write non-ascii text. This isnt always an issue but occasionally you may get some odd unicode character in on accident. The benefit of using the csv library is that you dont have to worry about putting in your \n or joining the list into a string. The library does that for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here I used describe to list the fields and iterate over that. You can take that out if you would like and only put in a list of the fields you want to use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outfile=open(YOUR CSV.csv'w') #Open a new file to write
FeatureClass=arcpy.Describe(YOUR FEATURE CLASS)
fields=FeatureClass.Fields #Use arcpy.Describe to get the field names from the export of parce_test
 
header=[] #An empty list that will be populated with the field names
for field in fields: #For a field in the list fields,
&amp;nbsp;&amp;nbsp;&amp;nbsp; header.append(field.name) #append the name to the header list
outfile.write('%s\n' % ','.join(header[2:]))#Write the header list to the TXT. The list the sliced using [2:] to drop the first two list items which are OID and Shape because I dont want them
 
cursor=arcpy.SearchCursor(YOUR FEATURE CLASS)
for row in cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]#Empty list to hold the data for the each row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in fields:#Same deal as before. For a field in the list fields,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(row.GetValue(field.Name))#add that to the end of the list "line" and repeat till out of fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile.write('%s\n' % ','.join(line[2:]))#Write the list to the TXT, again dropping the first two fields
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Borked row: %s' % row.OID #If a line has a problem print the OID and move on. 
 
del cursor #Delete the cursor object because this is what is holding a schema lock
outfile.close()#Close the TXT so that a lock is dropped from it as well.
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yours could be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outfile=open(YOUR CSV.csv'w') #Open a new file to write
 
header=["ID", "x_1", "y_2", "i", "r", "height"] 
outfile.write('%s\n' % ','.join(header))#Write the header list to the TXT.&amp;nbsp; 
cursor=arcpy.SearchCursor(YOUR LIDAR)
for row in cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in header:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(row.GetValue(field))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile.write('%s\n' % ','.join(line))
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Borked row: %s' % row.OID
 
del cursor
outfile.close()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:09:18 GMT</pubDate>
    <dc:creator>ChrisMathers</dc:creator>
    <dc:date>2021-12-11T07:09:18Z</dc:date>
    <item>
      <title>Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125651#M4351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This isnt a question its a post about a result! I spent some time trying to find a way to take the attribute table of a shapefile and make it a CSV from python. I looked at an ArcScript that was rather complicated and didnt work with the current geoprocessor anyways. The old forums had a couple topics on the matter as well and none of the replys were really what I wanted. I wanted to avoid using win32com to call to excel or anything like that. Thats just seems messy to me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The answer came in a flash before leaving work last night, combine gp.Describe with gp.SearchCursor. Using the CSV library that ships with Python, you can open a new file and pass list objects into it. I iterate though the rows with a search cursor and for each row, iterate through the fields with a for-in loop. Each pass of the for loop appends the value of the field for the row to a list. That list is written to the CSV as a full line in the table. Youll notice in the while loop that during each pass I create and delete the list object "line." This may not be nessessary but I wanted to be safe and not accidentally be adding to the same very long list instead of creating a new list for each line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, csv
gp=arcgisscripting.create(9.3)

output=open(r'C:\GIS Projects\sandbox\test.csv','w')
linewriter=csv.writer(output,delimiter=',')

fcdescribe=gp.Describe('C:\\GIS Projects\\sandbox\\New_Shapefile(3).shp')
flds=fcdescribe.Fields

header=[]
for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; value=fld.Name
&amp;nbsp;&amp;nbsp;&amp;nbsp; header.append(value)
linewriter.writerow(header)

cursor=gp.SearchCursor('C:\\GIS Projects\\sandbox\\New_Shapefile(3).shp')
row=cursor.Next()

while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=row.GetValue(fld.Name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; linewriter.writerow(line)
&amp;nbsp;&amp;nbsp;&amp;nbsp; del line
&amp;nbsp;&amp;nbsp;&amp;nbsp; row=cursor.Next()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del cursor
output.close()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This method has the drawback of giving you a field for the OID and geometry in the CSV. You can get around this by getting rid of the gp.Describe and just making a list object full of your field names and using that. I made this process for a larger script that deals with updates to a parcels feature class so I will always be exporting the same fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;header=['Id','C','D','AtoC','BtoD']
linewriter.writerow(header)

cursor=gp.SearchCursor('C:\\GIS Projects\\sandbox\\New_Shapefile(3).shp')
row=cursor.Next()

while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in header:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=row.GetValue(fld)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; linewriter.writerow(line)
&amp;nbsp;&amp;nbsp;&amp;nbsp; del line
&amp;nbsp;&amp;nbsp;&amp;nbsp; row=cursor.Next()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps someone out there because it had me stumped for a good while. For some reason excel wants to open this with a blank line between each record. Im not sure why but I think it has to do with what CSV dialect you set it to. I dont set one here because I change the extension to txt and cram the table into a building permit tracking system. If you want to use this to make fancier CSVs the documentation for the CSV library is &lt;/SPAN&gt;&lt;A href="http://docs.python.org/library/csv.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: Just had a thought. A list is a 0 based array, so if you want to keep gp.Describe, you can just pass the list using the syntax line[2:]. That way you add every list item except the first two (OID and Shape).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125651#M4351</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2021-12-11T07:09:04Z</dc:date>
    </item>
    <item>
      <title>Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125652#M4352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Interesting idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did something similar about a year ago using a SearchCursor, ListFields &amp;amp; a simple File I/O.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, os
gp = arcgisscripting.create()

gp.workspace = os.getcwd()

for table in os.listdir(''):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if table.endswith('dbf'):

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the output file name the same as the shapfile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFile = open(table[:-3]+"csv", 'a')&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; ## Append all the field names to the fldList
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fldList = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fld = gp.listFields(table)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field = fld.next()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while field:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Don't include ESRI's "FID" or "SHAPE" or "OID" fields.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if field.name &amp;lt;&amp;gt; "FID" and field.name &amp;lt;&amp;gt; "Shape" and field.name &amp;lt;&amp;gt; "OID":
&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; fldList.append(field.name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field = fld.next()&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; ## Write the field names to the outFile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get the length of the fldList so we know when not to add the delimiter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total = len(fldList)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fieldName in fldList:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = count+1&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimeter = ","
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If you're not the last value in the list, add the delimiter; else, don't add it
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not count == total:
&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; outFile.write(fieldName+delimeter)
&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; outFile.write(fieldName+"\n")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printrow = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## Write the row values to the outFile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = gp.SearchCursor(table)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.Next()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printrow=printrow+1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print printrow
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create a list for each row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; valList = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fieldName in fldList:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimeter = ","
&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; value = row.GetValue(fieldName)
&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; # Append each row of values to the valList
&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; valList.append(value)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = 0&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Go through the list of values and add the delimiter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for val in valList:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = count+1
&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; # If you're not the last value in the list, add the delimiter; else, don't add it
&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; if not count == total:
&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; outFile.write(str(val)+delimeter)
&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; 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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFile.write(str(val)+"\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.Next()

print "\nDone.\n"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125652#M4352</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2021-12-11T07:09:07Z</dc:date>
    </item>
    <item>
      <title>Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125653#M4353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can also use sets to remove unwanted fields from lists, then convert back to a list.&amp;nbsp; This removes the need for potentially long if statements.&amp;nbsp; In the example below, the all_fields could be replaced by gp.ListFields.&amp;nbsp; The alternate method not involving sets follows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; no_good_fields
['FID', 'Shape', 'OID']
&amp;gt;&amp;gt;&amp;gt; all_fields
['Area', 'Perimeter', 'Shape', 'FID', 'OID']
&amp;gt;&amp;gt;&amp;gt; good_fields = list(set(all_fields) - set(no_good_fields))
&amp;gt;&amp;gt;&amp;gt; for a_field in good_fields:
...&amp;nbsp; print a_field
...&amp;nbsp; 
Perimeter
Area

&amp;gt;&amp;gt;&amp;gt; no_good_fields = ['FID', 'Shape', 'OID']
&amp;gt;&amp;gt;&amp;gt; all_fields = ['Area', 'Perimeter', 'Shape', 'FID', 'OID']
&amp;gt;&amp;gt;&amp;gt; for a_field in all_fields:
...&amp;nbsp; if a_field not in no_good_fields:
...&amp;nbsp;&amp;nbsp; print a_field
...&amp;nbsp;&amp;nbsp; 
Area
Perimeter

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125653#M4353</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T07:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125654#M4354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, csv
gp=arcgisscripting.create(9.3)

output=open(r'C:\GIS Projects\sandbox\test.csv','w')
linewriter=csv.writer(output,delimiter=',')

fcdescribe=gp.Describe('C:\\GIS Projects\\sandbox\\New_Shapefile(3).shp')
flds=fcdescribe.Fields

header=[]
for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; value=fld.Name
&amp;nbsp;&amp;nbsp;&amp;nbsp; header.append(value)
linewriter.writerow(header)

cursor=gp.SearchCursor('C:\\GIS Projects\\sandbox\\New_Shapefile(3).shp')
row=cursor.Next()

while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=row.GetValue(fld.Name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; linewriter.writerow(line)
&amp;nbsp;&amp;nbsp;&amp;nbsp; del line
&amp;nbsp;&amp;nbsp;&amp;nbsp; row=cursor.Next()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del cursor
output.close()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really appreciate the code that you shared. I have to work with a lot of parcel data as well, which happens to be why I was looking for this solution...as part of my bigger solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the code as is with the exception that I passed in some arguments, but I get the following error when I run the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.TypeError'&amp;gt;: 'geoprocessing list object' object is not iterable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It creates the csv file and then errors out. Any thoughts on what might be wrong? Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

# Import system modules
import sys, string, os, arcgisscripting, csv

# Create the Geoprocessor object
gp = arcgisscripting.create()


# Local variables...
OutputFileName = sys.argv[1]
Target_FC = sys.argv[2]

output=open(OutputFileName,'w')
linewriter=csv.writer(output,delimiter=',')

fcdescribe=gp.Describe(Target_FC)
flds=fcdescribe.Fields

header=[]
for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; value=fld.Name
&amp;nbsp;&amp;nbsp;&amp;nbsp; header.append(value)
linewriter.writerow(header)

cursor=gp.SearchCursor(Target_FC)
row=cursor.Next()

while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=row.GetValue(fld.Name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; linewriter.writerow(line)
&amp;nbsp;&amp;nbsp;&amp;nbsp; del line
&amp;nbsp;&amp;nbsp;&amp;nbsp; row=cursor.Next()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del cursor
output.close()

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125654#M4354</guid>
      <dc:creator>KeithSandell</dc:creator>
      <dc:date>2021-12-11T07:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125655#M4355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you appear to be using arcmap 9.2 or below, the example below is a snippet which demonstrates the differences.&amp;nbsp; In 9.3, python list objects are now returned versus enumerations in previous versions.&amp;nbsp; You will have to modify your code to include the reset and next lines (in two locations) to reflect the differences.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; #9.2 and below
&amp;nbsp; fields.Reset()
&amp;nbsp; field = fields.Next()
&amp;nbsp; while field:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if field.Type in ok_fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num_fields.append(field.Name)
&amp;nbsp;&amp;nbsp;&amp;nbsp; field = fields.Next()
except:&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; #9.3 and above
&amp;nbsp; for field in fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if field.Type in ok_fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num_fields.append(field.Name)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125655#M4355</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T07:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125656#M4356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is sort of related to this... There's a script tool on the Model &amp;amp; Script tool gallery to output a table to HTML or excel.&amp;nbsp; It's &lt;/SPAN&gt;&lt;A href="http://resources.esri.com/geoprocessing/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15712"&gt;here&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 May 2010 17:31:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125656#M4356</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2010-05-13T17:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125657#M4357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I actually have an update for this. If you are using Windows, you have to open the output in binary mode. When each line is added python will put /r/n at the end of each line (a carriage return and a new line). Windows will intercede and add /r to each line which gives you /r/r/n. This means that excel or ArcGIS will have a blank line between each record. The new line should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;output=open(r'C:\GIS Projects\sandbox\test.csv','wb')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the link Dale. I was trying to use as little outside of the main python libraries as possible. If there was a DBF library I would forgo the geoprocessor entirly for this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 May 2010 17:58:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125657#M4357</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-05-17T17:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125658#M4358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;did you google "dbase Python" since there are a number out there ie&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://code.activestate.com/recipes/362715-dbf-reader-and-writer/"&gt;http://code.activestate.com/recipes/362715-dbf-reader-and-writer/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 09:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125658#M4358</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2010-05-18T09:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125659#M4359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;how would you get specific fields to write to csv file.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance with LiDAR data, maybe, how would you only write the six fields:&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"ID", "x_1", "y_2", "i", "r", "height"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can get the entire shape or dbf file to write as CSV but how to get just some of the fields?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Linda&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Dec 2010 20:26:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125659#M4359</guid>
      <dc:creator>LindaTedrow</dc:creator>
      <dc:date>2010-12-14T20:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Table to CSV</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125660#M4360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For this method just make a list of those fields and iterate over them to make your rows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the variable "header" would be ["ID", "x_1", "y_2", "i", "r", "height"].&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found a flaw with this though. Using the csv library is great if you are reading and writing a csv, but if you are only writing as is the case here, it is actually better to use the built in file object instead because the csv library cant write non-ascii text. This isnt always an issue but occasionally you may get some odd unicode character in on accident. The benefit of using the csv library is that you dont have to worry about putting in your \n or joining the list into a string. The library does that for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here I used describe to list the fields and iterate over that. You can take that out if you would like and only put in a list of the fields you want to use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outfile=open(YOUR CSV.csv'w') #Open a new file to write
FeatureClass=arcpy.Describe(YOUR FEATURE CLASS)
fields=FeatureClass.Fields #Use arcpy.Describe to get the field names from the export of parce_test
 
header=[] #An empty list that will be populated with the field names
for field in fields: #For a field in the list fields,
&amp;nbsp;&amp;nbsp;&amp;nbsp; header.append(field.name) #append the name to the header list
outfile.write('%s\n' % ','.join(header[2:]))#Write the header list to the TXT. The list the sliced using [2:] to drop the first two list items which are OID and Shape because I dont want them
 
cursor=arcpy.SearchCursor(YOUR FEATURE CLASS)
for row in cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]#Empty list to hold the data for the each row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in fields:#Same deal as before. For a field in the list fields,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(row.GetValue(field.Name))#add that to the end of the list "line" and repeat till out of fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile.write('%s\n' % ','.join(line[2:]))#Write the list to the TXT, again dropping the first two fields
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Borked row: %s' % row.OID #If a line has a problem print the OID and move on. 
 
del cursor #Delete the cursor object because this is what is holding a schema lock
outfile.close()#Close the TXT so that a lock is dropped from it as well.
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yours could be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outfile=open(YOUR CSV.csv'w') #Open a new file to write
 
header=["ID", "x_1", "y_2", "i", "r", "height"] 
outfile.write('%s\n' % ','.join(header))#Write the header list to the TXT.&amp;nbsp; 
cursor=arcpy.SearchCursor(YOUR LIDAR)
for row in cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line=[]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in header:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line.append(row.GetValue(field))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile.write('%s\n' % ','.join(line))
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Borked row: %s' % row.OID
 
del cursor
outfile.close()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-table-to-csv/m-p/125660#M4360</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2021-12-11T07:09:18Z</dc:date>
    </item>
  </channel>
</rss>

