I want the output of my script to be like :
2 11
4 12
6 13
8 14
48 15
But output comes like:
2 48
4 48
6 48
8 48
48 48
Below is the code, can somebody please help what I'm doing wrong:
import xlwt
import xlrd
import sys ; sys.path
#Create workbook and worksheet
wbk = xlwt.Workbook()
sheet = wbk.add_sheet('Data_1')#name of the sheet in which new data is there
row = 0
f = xlrd.open_workbook('Data_1.xls')#workbook from where data is extracted
g = xlrd.open_workbook('Data_2.xls')#workbook from where data is extracted
sheet1 = f.sheet_by_index(0)
sheet2 = g.sheet_by_index(0)
for i in xrange(5):
temp = sheet1.row_values(i)
print temp
col = 0
for element in temp:
sheet.write(i,col,element)
col += 1
i += 1
for j in xrange(5):
temp1 = sheet2.row_values(j)
print temp1
col = 1
for elements in temp1:
sheet.write(j,col,element)
col +=1
j += 1
wbk.save('DATA.xls') #excel sheet name when saved in the folder