title: Writing an array from one Excel file to another in Python
body: <p>I have a script that converts an ESRI feature class attribute table to an excel file. Problem is it adds an object ID field in the process. This screws up the file for an upload to a database using a .dtt app that references a set array. Therefore I need the script to read the output excel file and add everything to a new excel file without the first column. Everything leading up to the xlrd and xlwt functions is working fine so I will exclude everything prior to the Table to excel conversion:</p>
  
  <pre><code>arcpy.TableToExcel_conversion(outTemplate, outXL)
  print "arcpy.AddMessage(Creating GoLive_+glName)"
  
  workbook = xlrd.open_workbook(outXL)
  writeBook = r"S:Upload\SVRSTA00.xls"
  
  sheet = workbook.sheet_by_index(0)
  
  cell_range_value = 0
  for value in sheet.col(32):
      cell_range_value += 1
  print cell_range_value
  
  dct1 = {}
  for i in range(1, cell_range_value,1):
      data = [sheet.cell_value(i, col) for col in range(sheet.ncols)[1:]]
      cell_value_class = sheet.cell(i,32).value
      cell_value_id = data
      dct1[cell_value_class] = cell_value_id
  
  print 
  
  workbook = xlwt.Workbook()
  sheet = workbook.add_sheet('SVRSTA00')
  
  for index, value in enumerate(dct1):
      sheet.write(0, index, value)
  
  workbook.save(writeBook)
  </code></pre>
  
  <p>This is the error I'm getting:</p>
  
  <pre><code>ValueError: column index (u'181011020') not an int in range(256)
  </code></pre>