在命令行上将XLS转换为CSV如何在windows命令行中将XLS文件转换为CSV文件。这台机器安装了MicrosoftOffice 2000。如果不可能使用MicrosoftOffice,我愿意安装OpenOffice。
3 回答
噜噜哒
TA贡献1784条经验 获得超7个赞
if WScript.Arguments.Count < 2 Then WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv" Wscript.QuitEnd IfDim oExcelSet oExcel = CreateObject("Excel.Application")Dim oBookSet oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))oBook.SaveAs WScript.Arguments.Item(1), 6oBook.Close FalseoExcel.Quit WScript.Echo "Done"
XlsToCsv.vbs [sourcexlsFile].xls [destinationcsvfile].csv
Smart猫小萌
TA贡献1911条经验 获得超7个赞
if WScript.Arguments.Count < 2 Then WScript.Echo "Please specify the source and the destination files. Usage: ExcelToCsv <xls/xlsx source file> <csv destination file>" Wscript.Quit End If csv_format = 6 Set objFSO = CreateObject("Scripting.FileSystemObject") src_file = objFSO.GetAbsolutePathName(Wscript.Arguments.Item(0)) dest_file = objFSO.GetAbsolutePathName(WScript.Arguments.Item(1)) Dim oExcel Set oExcel = CreateObject("Excel.Application") Dim oBook Set oBook = oExcel.Workbooks.Open(src_file) oBook.SaveAs dest_file, csv_format oBook.Close False oExcel.Quit
慕桂英3389331
TA贡献2036条经验 获得超8个赞
FOR /f "delims=" %%i IN ('DIR *.xlsx /b') DO ExcelToCSV.vbs "%%i" "%%i.csv"
添加回答
举报
0/150
提交
取消