View difference between Paste ID: QyrVgChu and sZ6VCevF
SHOW: | | - or go back to the newest paste.
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=';')
9
        c = csv.writer(f)
10
        
11-
        for row in range(sh.nrows):
11+
        for row in range(1,(sh.nrows)):
12-
            #for col in range(sh.ncols):
12+
            if row=!None:               
13-
            c.writerow(sh.row_values(row))
13+
                for col in range(sh.ncols):
14
                    c.writerow(sh.row_values(row)