Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import sys, os, xlrd, csv, codecs
- xlsFileName = sys.argv[1]
- csvFileName = xlsFileName + '.csv'
- columnsTotalCout = int(sys.argv[2])
- print columnsTotalCout
- if os.path.exists(xlsFileName):
- book = xlrd.open_workbook(xlsFileName)
- sh = book.sheet_by_index(0)
- f = codecs.open(csvFileName, "wb", "utf-8")
- #csvFile=csv.writer(open(csvFileName, 'wb'), delimiter="\t")
- csvFile=csv.writer(f , delimiter="\t")
- for rownum in range(sh.nrows):
- print sh.row_values(rownum)[:columnsTotalCout][3]
- #f.write(sh.row_values(rownum)[:columnsTotalCout][3]);
- csvFile.writerow(sh.row_values(rownum)[:columnsTotalCout][3])
- exit();
Add Comment
Please, Sign In to add comment