Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import xlrd
- import pandas as pd
- from xlrd import open_workbook
- from xlwt import Workbook
- rb = open_workbook('Pilvetyybid_1966_Parnu.xls',formatting_info=False)
- for a, name in enumerate(rb.sheet_names()):
- rs = rb.sheet_by_index(a)
- new_book = Workbook()
- new_sheet = new_book.add_sheet('Sheet 1')
- for col in range(rs.ncols):
- if col ==0 or col>10:
- pass
- else:
- for row in range (rs.nrows):
- #rs.row_slice(row,start_colx=1, end_colx=10)
- if row == 0:
- pass
- else:
- new_sheet.write(row, col, rs.cell(row, col).value)
- new_book.save(jaamanimi + ".xls")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement