title: Condense information from multiple spreadsheets to one using python
body: <p>I have perhaps a thousand invoices in Excel, all of which have the Client/Name in B2 with the address split into B3 and B4 with B3 having the Number and street name, and the city, state, and zip in B4. What I am trying to do is open each of these excel files, (all are in the same directory) and extract the name and address to create a new spreadsheet with the information in it.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>import glob
  from xlrd import open_workbook, XL_CELL_TEXT
  from xlwt import Workbook
  from tempfile import TemporaryFile
  
  invoices = glob.glob("C:\emma\*.xls")
  wbook = Workbook()
  wsheet = wbook.add_sheet('Sheet 1')
  R = 0
  
  for x in invoices:
      rbook = open_workbook(x)
      rsheet = rbook.sheet_by_index(1)
      ncell = rsheet.cell(1,1)
      acell1 = rsheet.cell(1,2)
      acall2 = rsheet.cell(1,3)
      name = ncell.value
      address = acell1.value + " " + acell2.value
  
      wsheet.write(R,0,name)
      wsheet.write(R,1,address)
  
      R = R + 1
  
  wbook.save('addresses.xls')
  wbook.save(TemporaryFile())
  </code></pre>
  
  <p>As of right now it does not function. Here is the error I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\emma\emma.py", line 14, in &lt;module&gt;
      ncell = rsheet.cell(1,1)
    File "C:\Python27\lib\site-packages\xlrd\sheet.py", line 399, in cell
      self._cell_types[rowx][colx],
  IndexError: list index out of range
  </code></pre>
  
  <p>I am not quite sure what is causing this error.</p>