all:bibles:langages:perl
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| all:bibles:langages:perl [2026/01/07 10:09] – [Utilisation] omeylhoc | all:bibles:langages:perl [2026/01/07 10:13] (Version actuelle) – [Librairie Excel::Writer::XLSX] omeylhoc | ||
|---|---|---|---|
| Ligne 1550: | Ligne 1550: | ||
| ===== Fichier excel ===== | ===== Fichier excel ===== | ||
| + | |||
| + | ==== Librairie Excel:: | ||
| + | |||
| + | === Installation === | ||
| + | |||
| + | <code bash> | ||
| + | sudo apt install libspreadsheet-writeexcel-perl libexcel-writer-xlsx-perl | ||
| + | </ | ||
| + | |||
| + | === Utilisation === | ||
| + | |||
| + | <code perl> | ||
| + | # | ||
| + | use strict; | ||
| + | use warnings; | ||
| + | use Excel:: | ||
| + | |||
| + | # Création du fichier Excel | ||
| + | my $workbook = Excel:: | ||
| + | my $worksheet = $workbook-> | ||
| + | |||
| + | # Création d'un format pour les en-têtes | ||
| + | my $header_format = $workbook-> | ||
| + | $header_format-> | ||
| + | |||
| + | # Ajout des en-têtes | ||
| + | $worksheet-> | ||
| + | $worksheet-> | ||
| + | $worksheet-> | ||
| + | |||
| + | # Ajout des données | ||
| + | $worksheet-> | ||
| + | $worksheet-> | ||
| + | $worksheet-> | ||
| + | |||
| + | $worksheet-> | ||
| + | $worksheet-> | ||
| + | $worksheet-> | ||
| + | |||
| + | # Fermeture du fichier | ||
| + | $workbook-> | ||
| + | |||
| + | print "Le fichier nouveau_document.xlsx a été créé avec succès.\n"; | ||
| + | </ | ||
| ---- | ---- | ||
all/bibles/langages/perl.1767776961.txt.gz · Dernière modification : de omeylhoc
