<?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: Problem writing all columns with xlwt in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-writing-all-columns-with-xlwt/m-p/159991#M12253</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The simple answer is to just repeat the .write() for each column.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a cleaner way to do this though, anyone?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 May 2013 16:44:44 GMT</pubDate>
    <dc:creator>ChrisBrannin</dc:creator>
    <dc:date>2013-05-21T16:44:44Z</dc:date>
    <item>
      <title>Problem writing all columns with xlwt</title>
      <link>https://community.esri.com/t5/python-questions/problem-writing-all-columns-with-xlwt/m-p/159990#M12252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, I am having an issue getting all of the values from my table written into the .xls I can get a single row, but need all of the columns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Use row object to get and set field values cur = arcpy.SearchCursor(data_source)&amp;nbsp;&amp;nbsp; # Set up workbook and sheet book = Workbook() sheet1 = book.add_sheet('Points')&amp;nbsp;&amp;nbsp; # Set counter rowx = 0&amp;nbsp;&amp;nbsp; # Loop through rows in dbf file. arcpy.AddMessage(cur) for row in cur: &amp;nbsp;&amp;nbsp;&amp;nbsp; rowx += 1 &amp;nbsp;&amp;nbsp;&amp;nbsp; # Write each row to the sheet from the workbook. Set column index in sheet for each column in .dbf &amp;nbsp;&amp;nbsp;&amp;nbsp; sheet1.write(rowx,0,row.ID) &amp;nbsp;&amp;nbsp;&amp;nbsp; book.save('C:/Output')&amp;nbsp;&amp;nbsp; print"Export finished" &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the line &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;sheet1.write(rowx,0,row.ID)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need 3 parameters where rowx = walks through and gets all values in every row - 0 = column index of where the values are written in the xls &amp;amp; row.ID = the column that is being written from table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 15:52:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-writing-all-columns-with-xlwt/m-p/159990#M12252</guid>
      <dc:creator>ChrisBrannin</dc:creator>
      <dc:date>2013-05-21T15:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem writing all columns with xlwt</title>
      <link>https://community.esri.com/t5/python-questions/problem-writing-all-columns-with-xlwt/m-p/159991#M12253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The simple answer is to just repeat the .write() for each column.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a cleaner way to do this though, anyone?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 16:44:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-writing-all-columns-with-xlwt/m-p/159991#M12253</guid>
      <dc:creator>ChrisBrannin</dc:creator>
      <dc:date>2013-05-21T16:44:44Z</dc:date>
    </item>
  </channel>
</rss>

