将 XLS 转换为 CSV

Perl 用于将 XLS 转换为 CSV 的库

使用 Cells 云的转换 API 在 Perl 项目中创建自定义电子表格工作流程。这是使用 Perl 在线将 XLS 转换为 CSV 和其他文档格式的专业解决方案。

使用 Cells Cloud SDK for Perl 将 XLS 转换为 CSV

API
PUT
https://api.aspose.cloud/v3.0/cells/convert

将文件格式从 XLS 转换为 CSV 可能是一项复杂的任务。我们的 Perl SDK 处理所有 XLS 到 CSV 格式的转换,同时保留源 XLS 电子表格的主要结构和逻辑内容。我们的 Perl 库提供了在线将 XLS 转换为 CSV 文件的专业解决方案。该Cloud SDK为Perl开发者提供了强大的功能,并确保高质量的CSV输出。

Perl 使用 Cells Cloud SDK 将 XLS 转换为 CSV 的代码示例

# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-perl/
    use strict;
    use warnings;
    use utf8; 
    use File::Slurp;
    use AsposeCellsCloud::CellsApi;
    my $config = AsposeCellsCloud::Configuration->new( client_id => $ENV{'ProductClientId'}, client_secret => $ENV{'ProductClientSecret'});
    my $instance = AsposeCellsCloud::CellsApi->new(AsposeCellsCloud::ApiClient->new( $config));
    my $format = "csv";
    my $Book1Data = undef;
    my $result =undef;
    my @fileinfos = stat("Book1.xls");
    my $filelength = $fileinfos[7];
    open(DATA, '<', "Book1.xls") or die "file can not open, $!";
    binmode(DATA);
    read (DATA, $Book1Data, $filelength);
    close (DATA); 
    $result = $instance->cells_workbook_put_convert_workbook(workbook => $Book1Data, format => $format);
    open(my $fh, '>', "Dest.csv") or die "Could not open file!";
    binmode $fh;
    print $fh $result;
    close $fh;


如何使用Perl SDK将XLS转换为CSV

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


系统要求

  1. Perl 5