<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>
&nbsp;<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>&nbsp; <BR># Create workbook and worksheet <BR>wbk = xlwt.Workbook() <BR>sheet = wbk.add_sheet('python')<BR>row = 0&nbsp; # row counter<BR>f = open('robert.txt')<BR>
for line in f:<BR>&nbsp;&nbsp;&nbsp; L = line.strip()&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; print L<BR>&nbsp;&nbsp;&nbsp; for c in L:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print c<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sheet.write(row,0,c)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row += 1<BR>&nbsp;&nbsp;&nbsp; <BR>wbk.save('reformatted.data.xls')<BR>&nbsp;<BR>
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor                                               </body>
</html>