I download .xlsx from win32com and would like to save the results as csv when done.
myworkbook.SaveAs('results.csv')
gives me an xlsx file with the csv extension. How to save as actual CSV?
I think that if you add a type after the file name, it should work. (Canβt check right now.)
I think the type for CSV (DOS) is 24.
myworkbook.SaveAs('results.csv', 24)
Here are the docs for saveAs: http://msdn.microsoft.com/en-us/library/bb214129.aspx
from win32com.client import constants as c myWorkBook.SaveAs('results.csv', c.xlCSV)
, , , :
http://pypi.python.org/pypi/ooxml
.
CSV :
xlCSV = 6 # Comma separated value. xlCSVMac = 22, # Comma separated value. xlCSVMSDOS = 24, # Comma separated value. xlCSVWindows =23, # Comma separated value.
, saveAs . python, .