Convert XLS to CSV on command line

后端 未结 15 2320
臣服心动
臣服心动 2020-11-22 12:11

How could I convert an XLS file to a CSV file on the windows command line.

The machine has Microsoft Office 2000 installed. I\'m open to installing OpenOffice if it\

15条回答
  •  被撕碎了的回忆
    2020-11-22 12:49

    How about with PowerShell?

    Code should be looks like this, not tested though

    $xlCSV = 6
    $Excel = New-Object -Com Excel.Application 
    $Excel.visible = $False 
    $Excel.displayalerts=$False 
    $WorkBook = $Excel.Workbooks.Open("YOUDOC.XLS") 
    $Workbook.SaveAs("YOURDOC.csv",$xlCSV) 
    $Excel.quit()
    

    Here is a post explaining how to use it

    How Can I Use Windows PowerShell to Automate Microsoft Excel?

提交回复
热议问题