Forum


Replies: 1   Views: 152
How to convert an xlsx file to csv ?
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpxlsx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpxlsx version and check the Documentation available.

Posted by Elisee9571  · 10-04-2025 - 08:54

I am using the version 4 of phpxlsx with the bureau licence.

We are using namespaces package.

We are using php version 8.3.

Here is an extract from the code :

$file = $request->files->get('file');
if (!$file) {
   return new Response("Aucun fichier uploadé.", Response::HTTP_BAD_REQUEST);
}

$filePath = $file->getRealPath();

Is it possible to read an imported xlsx file and export it as a csv file?

I would like the CSV file to be encoded in UTF-8 and separated by semicolons (;).

 

Posted by admin  · 10-04-2025 - 09:35

Hello,

The current stable release of phpxlsx can import a CSV using addCsv, but there's no method to export an XLSX to CSV. We have added a task to be included in the next stable release of phpxlsx.

Regards.