<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
bug in the previous code so the final code should be:<BR>
<BR>
import xlwt<BR>"""Reads robert.txt<BR>This is the final script that writes by incrementing each row but maintain<BR>one column"""<BR> <BR># Create workbook and worksheet <BR>wbk = xlwt.Workbook() <BR>sheet = wbk.add_sheet('python')<BR>row = 0 # row counter<BR>f = open('robert.txt')<BR>
for line in f:<BR> L = line.strip() <BR> print L<BR> for c in L:<BR> print c<BR> sheet.write(row,0,c)<BR> row += 1<BR> <BR>wbk.save('reformatted.data.xls')<BR> <BR>
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor                                            </body>
</html>