hi,
i found a module called xlwt (http://www.python-excel.org/) that can write to Excel. i want the code to read from a file (robert.txt) and then write to excel in a column. however, it seems that the output from this code is that it only writes to one cell in the excel. Pls advise how to modify the code. Pls advise if there are alternative way for python to do this task? tq
import xlwt
# Create workbook and worksheet
wbk = xlwt.Workbook()
sheet = wbk.add_sheet('python')
row = 0 # row counter
f = open('robert.txt')
for line in f:
# separate fields by commas
#L = line.strip()
L = list(line)
sheet.write(row,0,L)
row += 1
wbk.save('reformatted.data.xls')