Skip to content

Instantly share code, notes, and snippets.

@jackyshan
Created December 7, 2016 03:56
Show Gist options
  • Save jackyshan/ae58b09dde41bca6126d90dac64f337e to your computer and use it in GitHub Desktop.
Save jackyshan/ae58b09dde41bca6126d90dac64f337e to your computer and use it in GitHub Desktop.
处理excel导出db数据
import xlrd
data = xlrd.open_workbook('xx.xls')
fo = open("xx.txt", "w")
for i in range(len(data.sheets())):
table = data.sheets()[i]
nrows = table.nrows
for row in range(nrows):
content = table.row_values(row)
fo.writelines(str(content) + '\n')
fo.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment