Excel 合併
動詞:excelMerge
可用來源: <Standard>
按照所設定的順序,將多個 Excel 檔案的內容合併為一個檔案。
語法
excelMerge --directory(String) [--filemask(String)] [--outputfile(String)] [--compatibilitymode(Boolean)] --fileordering(FileOrdering) (String)=file (Numeric)=numberoftabs
輸入
Script | 設計工具 | 必要 | 接受的類型 | 說明 |
---|---|---|---|---|
--directory | 目錄 | 必要 | Text | 檔案所在目錄的完整路徑。 |
--filemask | 檔案遮罩 | 選用項目 | Text | 將在搜尋中套用的過濾器。 它必須插入如下所示:[Name or part of the file name, spaces are not accepted in this part]. [File extension]。 以下是部分範例:輸入檔案的名稱時,它必須區分大小寫。 |
--outputfile | 輸出檔 | 選用項目 | Text | 要將多個 Excel 檔案的內容合併到其中的檔案的路徑。 |
--compatibilitymode | 相容模式 | 選用項目 | 布林值 | 如果有任何 Excel 檔案的副檔名與檔案遮罩 參數中指定的副檔名不同,則應使用此選項。 |
--fileordering | 檔案排序 | 必要 | 檔案順序 | 將檔案內容儲存到輸出檔案的順序。 |
輸出
Script | 設計工具 | 接受的類型 | 說明 |
---|---|---|---|
檔案 | 檔案 | Text | 傳回一個變數,其值為包含合併內容的檔案的完整路徑。 |
numberoftabs | 工作表數目 | 數字 | 傳回所建立的工作表數。 |
範例
在目錄 參數中指定目錄,以將多個檔案合併成輸出檔 參數中指定的單一 Excel 檔案。 記載訊息會記錄輸出檔 的完整路徑以及最終的試算表數。
defVar --name sourceFileFolder --type String
defVar --name sheetsQuantity --type Numeric
excelMerge --directory "Enter source directory" --outputfile "Enter the destination excel file" --fileordering "None" sourceFileFolder=file sheetsQuantity=numberoftabs
logMessage --message "\r\n${sourceFileFolder}\r\n${sheetsQuantity}" --type "Info"
下載檔案
備註
如果在輸出檔 中輸入了不存在的檔案,則會建立一個新的檔案,以包含目錄 中各檔案的內容。
檔案順序的選項: