Combine Excel Files using Java REST API

This tutorial explains the process to combine Excel files using Java REST API. You will learn to automatically combine Excel documents using Java REST Interface by utilizing a .Java-based Could SDK. It will assist you to merge as many files as required.

Prerequisite

Steps to Combine Multiple Excel Files using Java Low Code API

  1. Start by defining your Client ID, Client Secret, and the API Base URL provided by Aspose.Cloud
  2. Use the credentials and endpoint to initialize the CellsApi object, which allows access to all Excel-related operations
  3. Define the names of the two Excel files that you intend to merge
  4. Use the UploadFileRequest to upload both input files to Aspose Cloud storage by adding them to the UploadFiles dictionary
  5. Create and configure a PostWorkbooksMergeRequest and send it using the PostWorkbooksMerge method
  6. After merging, use the DownloadFileRequest to download the updated file from cloud storage and save it on disk

These steps summarize the process to combine Excel files into one using Java Low Code API. The code authenticates with Aspose.Cells Cloud API, uploads two Excel files to cloud storage, and sends a request to merge them. It then downloads the merged file and saves it locally as a new Excel document.

Code to Merge XLSX Files using Java REST API

The above code demonstrates how to merge Excel files into one using Java REST Interface. You can upload as many files as required in a single API call by filling the dictionary in the UploadFileRequest with the file name and contents. Finally, repeat the process to combine two files at a time by keeping the destination file name first in the PostWorkbooksMergeRequest and changing the secondary file name to merge all the sheets at the end.

This article has described how to merge Excel files. To add or insert a column in an Excel file, refer to the article Adding a column in Excel using Java REST API.

 English