View difference between Paste ID: xAtmbG2q and eAXQSraK
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=';', quotechar='|')
8+
        spamwriter = csv.writer(f, delimiter=';')
9
        c = csv.writer(f)
10
        
11
        for row in range(sh.nrows):
12-
            for col in range(sh.ncols):
12+
            #for col in range(sh.ncols):
13-
               c.writerow(sh.row_values(sh.nrows-1))
13+
            c.writerow(sh.row_values(sh.nrows-1))