Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import os
  2. import csv
  3. import xlrd
  4.  
  5. with xlrd.open_workbook('Pilvetyybid_1968_Jõgeva.xls') as wb:
  6. sh = wb.sheet_by_index(0) # or wb.sheet_by_name('name_of_the_sheet_here')
  7. with open('a_file.csv', 'w', newline='') as f:
  8. spamwriter = csv.writer(f, delimiter=';', quotechar='|')
  9. c = csv.writer(f)
  10. for col in range(1,(sh.ncols),10):
  11. for row in range(sh.nrows):
  12. if sh.row!=None:
  13. c.writerow(sh.row_values(sh.nrows-1))
  14. else:
  15. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement