daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding: utf-8 -*-
  2. import sys, os, xlrd, csv, codecs
  3. xlsFileName = sys.argv[1]
  4. csvFileName = xlsFileName  + '.csv'
  5. columnsTotalCout = int(sys.argv[2])
  6. print columnsTotalCout
  7.  
  8. if os.path.exists(xlsFileName):    
  9.     book = xlrd.open_workbook(xlsFileName)
  10.     sh = book.sheet_by_index(0)
  11.     f = codecs.open(csvFileName, "wb", "utf-8")
  12.     #csvFile=csv.writer(open(csvFileName, 'wb'), delimiter="\t")
  13.     csvFile=csv.writer(f , delimiter="\t")
  14.    
  15.     for rownum in range(sh.nrows):
  16.         print sh.row_values(rownum)[:columnsTotalCout][3]
  17.         #f.write(sh.row_values(rownum)[:columnsTotalCout][3]);
  18.         csvFile.writerow(sh.row_values(rownum)[:columnsTotalCout][3])
  19.         exit();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top