Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/03/2013, 12:46
Avatar de razpeitia
razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años, 1 mes
Puntos: 1360
Respuesta: Filtar filas de mi xls, ultimo retoque

1.- El archivo si tiene que ver, por que así no tengo andar adivinando que datos estas usando.
2.- Segundo, no copies y pegues código sin saber que hace.
3.- Publica el error que te arroja, de otra forma no sabemos que esta mal.

Código Python:
Ver original
  1. import xlwt
  2. import xlrd
  3. book = xlrd.open_workbook("tarifa.xls")
  4. sh = book.sheet_by_index(0)
  5. wb = xlwt.Workbook()
  6. ws = wb.add_sheet('A Test Sheet',cell_overwrite_ok=True)
  7. i = 0
  8. for rx in range(sh.nrows):
  9.     row = sh.row(rx)
  10.     if row[3].value == 'APPLE':
  11.         for j, cell in enumerate(row):
  12.             ws.write(i, j, cell.value)
  13.         i += 1
  14. wb.save('example.xls')

Aquí te dejo el archivo tarifa.xls que use.
https://dl.dropbox.com/u/107554552/tarifa.xls