From 714e52820167e1f408b53796aed3f45e16c24673 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 29 Nov 2024 16:54:12 +0400 Subject: [PATCH] ajout de csv2xlsx --- .idea/php.xml | 4 +++- bin/csv2xlsx.php | 7 +++++++ composer.json | 12 ++++++++++++ composer.lock | 36 ++++++++++++++++++++-------------- src_glue/tools/Csv2xlsxApp.php | 25 +++++++++++++++++++++++ 5 files changed, 68 insertions(+), 16 deletions(-) create mode 100755 bin/csv2xlsx.php create mode 100644 src_glue/tools/Csv2xlsxApp.php diff --git a/.idea/php.xml b/.idea/php.xml index 557c1db..6a1b2d2 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -12,7 +12,6 @@ - @@ -59,6 +58,9 @@ + + + diff --git a/bin/csv2xlsx.php b/bin/csv2xlsx.php new file mode 100755 index 0000000..0f0bb32 --- /dev/null +++ b/bin/csv2xlsx.php @@ -0,0 +1,7 @@ +#!/usr/bin/php +args[0] ?? null); + $inputname = path::filename($input); + $output = path::ensure_ext($inputname, ".xlsx", ".csv"); + + $reader = SsReader::with($input); + $builder = SsBuilder::with($output); + $builder->writeAll($reader); + $builder->build(); + $builder->copyTo(file::writer($output), true); + } +}