合并多个Excel文件到一个文件 - BAT脚本示例
@echo off/nset /'outputFile=C:/Users/Marc/Desktop/key/merged.xlsx/'/n/nREM Create an empty temporary file/necho. > temp.csv/n/nREM Loop through each Excel file in the specified folder/nfor %%f in (C:/Users/Marc/Desktop/key//*.xlsx) do (/n REM Convert each Excel file to CSV format/n echo Converting /'%%f/' to CSV format.../n /'C:/Program Files/Microsoft Office/Office16/excel.exe/' /'%%f/' /r /e /x /'temp.csv/'/n/n REM Append the contents of the CSV file to the output file/n echo Appending /'%%f/' to the output file.../n type /'temp.csv/' >> /'%outputFile%/'/n)/n/nREM Delete the temporary file/ndel temp.csv/n/necho All files merged successfully into /'%outputFile%/'./npause
原文地址: https://www.cveoy.top/t/topic/pE42 著作权归作者所有。请勿转载和采集!