Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import xlrd
- filename = sys.argv[1]
- sheet = xlrd.open_workbook(filename).sheet_by_index(0)
- #sheet = book.sheet_by_index(0)
- csv_filename = filename.replace(".xlsx", ".csv")
- csv_fh = open(csv_filename, 'w')
- for rownum in range(2, sheet.nrows):
- if isinstance(sheet.cell(rownum, 1).value, float):
- print(int(sheet.cell_value(rownum,1)))
- csv_fh.write(str(int(sheet.cell_value(rownum,1))) + '\n')
Add Comment
Please, Sign In to add comment