Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xlwt, xlrd, string
- File = open('filepath', 'r')
- print File
- wb = xlwt.Workbook()
- ws = wb.add_sheet("Prices")
- XlsRow = 0
- XlsCol = 0
- for line in File:
- line = string.lstrip(line)
- line = string.split(line, ",")[0]
- if string.find(line, 'Bat of'):
- XlsCol = 0
- #write(r, c, label="", style=Style.default_style)
- ws.write(XlsRow, XlsCol, line)
- XlsRow += 1
- else:
- XlsCol += 1
- ws.write(XlsRow, XlsCol, line)
- # print line
- File.close()
- wb.save('Prices.xls')
- print "All Done."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement