A simple command-line tool built with Laravel Zero to convert Excel files to CSV format.
- Convert Excel files (
.xlsx,.xls,.ods) to CSV format - Support for multiple sheets - creates separate CSV files for each sheet by default
- Option to combine all sheets into a single CSV file
- Custom output directory support
- Clean error handling and user feedback
- Clone or download this project
- Install dependencies:
composer install
Convert an Excel file to CSV (creates separate files for each sheet):
php application excel:to-csv path/to/your/file.xlsxThis will create CSV files in the same directory as the input file:
file_Sheet1.csvfile_Sheet2.csv- etc.
Specify a custom output directory:
php application excel:to-csv path/to/your/file.xlsx --output=output/directoryCombine all sheets into a single CSV file:
php application excel:to-csv path/to/your/file.xlsx --single-fileWhen using --single-file, sheets are separated by empty lines and sheet headers.
# Convert Excel file to separate CSV files
php application excel:to-csv data.xlsx
# Convert to single CSV file
php application excel:to-csv data.xlsx --single-file
# Convert with custom output directory
php application excel:to-csv data.xlsx --output=converted
# Combine both options
php application excel:to-csv data.xlsx --single-file --output=converted- Excel 2007+ (
.xlsx) - Excel 97-2003 (
.xls) - OpenDocument Spreadsheet (
.ods)
- PHP 8.2+
- Composer
laravel-zero/framework- Console application frameworkphpoffice/phpspreadsheet- Excel file processing
MIT License