Konvertieren Sie CSV in XML mit dem Cloud SDK Cells für Perl
API
PUT
https://api.aspose.cloud/v3.0/cells/convert
Das Konvertieren von Dateiformaten von CSV in XML kann eine komplexe Aufgabe sein. Unser SDK Perl übernimmt alle Konvertierungen von CSV in XML und bewahrt dabei den strukturellen und logischen Hauptinhalt der CSV-Quelltabelle. Unsere Bibliothek Perl bietet eine professionelle Lösung für die Online-Konvertierung von CSV- in XML-Dateien. Dieses Cloud-SDK bietet Perl-Entwicklern leistungsstarke Funktionen und gewährleistet eine hochwertige XML-Ausgabe.
Perl Codebeispiel zur Konvertierung von CSV in XML mit Cells Cloud SDK
# 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 = "xml";
my $Book1Data = undef;
my $result =undef;
my @fileinfos = stat("Book1.csv");
my $filelength = $fileinfos[7];
open(DATA, '<', "Book1.csv") 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.xml") or die "Could not open file!";
binmode $fh;
print $fh $result;
close $fh;
So konvertieren Sie CSV mithilfe der Cloud-Bibliothek Cells in XML.
- Registrieren Sie ein Konto unterArmaturenbrett um ein kostenloses API-Kontingent und Autorisierungsdetails zu erhalten
- Installieren Sie das Paket Perl und fügen Sie Ihrem Projekt die Referenz hinzu (importieren Sie die Bibliothek).
- Öffnen Sie die Quelldatei in Perl.
- Verwenden Sie die Methode `put_convert_workbook`, um den resultierenden Stream abzurufen.
System Anforderungen
- Perl 5