从 Excel 导出工作簿到 CSV

用于将 WORKBOOK 导出到 CSV 文件的 Android 库

使用 Cells Cloud 的 Export API 在 Android 中导出 Excel 文件内部对象工作流。这是使用 Android 在线将 WORKBOOK 从电子表格导出为 CSV 格式文件的专业解决方案。

使用 Cells Cloud SDK for Android 将 WORKBOOK 对象导出为 CSV 格式文件

API
POST
https://api.aspose.cloud/v3.0/cells/export

将 WORKBOOK 对象从 Excel 文件导出到 CSV 文件是一项复杂的任务。将 WORKBOOK 导出到 CSV 格式的转换由我们的 Android SDK 执行,同时保留源 WORKBOOK 电子表格的主要结构和逻辑内容。我们的 Android 库是在线将 WORKBOOK 对象导出为 CSV 格式文件的专业解决方案。该Cloud SDK为Android开发人员提供了强大的功能和完美的CSV输出。

Android 中使用 REST API 将电子表格中的 WORKBOOK 导出为 CSV 格式的代码示例

// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-android/
    import java.io.*;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Base64;
    import com.aspose.cloud.cells.api.*;
    import com.aspose.cloud.cells.model.*;
    public class Export {
        public static void main(String[] args) {
            String format = "csv";
            String objectType = "workbook";
            HashMap<String,File> fileMap = new HashMap<String,File>();
            fileMap.put("Book1.xlsx" ,new File("C:\Book1.xlsx") );
            fileMap.put("myDocument.xlsx" ,new File("C:\myDocument.xlsx") );
            try {
                LightCellsApi cellsApi = new LightCellsApi(System.getenv("ProductClientId"), System.getenv("ProductClientSecret"),"v3.0","https://api.aspose.cloud");
                FilesResult response = cellsApi.postExport(fileMap,objectType, format,null);            
                List<FileInfo> files = response.getFiles();
                String filename = files.get(0).getFilename();
                String fileContent = files.get(0).getFileContent();
                byte[] data = Base64.getDecoder().decode(fileContent);
                OutputStream outputStream = new FileOutputStream(filename);
                outputStream.write(data,0,data.length);
                outputStream.close();
            }catch(Exception exception )
            {
                System.out.print(exception);
            }
        }
    }


如何使用 Cells Cloud SDK for Android 将对象从 Excel WORKBOOK 导出到 CSV

  1. 注册一个帐户仪表板获取免费API配额和授权详细信息
  2. 使用您的客户端 ID、客户端密钥、基本 URL 和 API 版本初始化 Cells API。
  3. 使用 `postExport` 方法检索结果流。


系统要求

  1. Android 7 或更高版本
  2. Java(TM) SE 运行时环境