A lightweight PHP utility for reading a CSV file, updating specific columns, and automatically generating a corrected output file. This project is designed for developers and administrators who need to perform bulk CSV processing without complex setup or dependencies.
- Read an existing CSV file (
file_example.csv) - Iterate through rows and update targeted columns
- Generate a new output file (
file_example_fixed.csv) - Includes sample files for quick testing
- Copy the project into a directory accessible by your PHP server.
- Ensure PHP is installed and properly configured on your machine.
- Place the source CSV file in the project directory as
file_example.csv, or update the file path inindex.php.
cd /var/www/html/php-excel-file-updater- Open
index.php. - Customize the transformation logic as needed, for example:
$data[7] = "Written by Cyrus"; // Updates the 8th column (index 7)- Access the script through your web server:
http://localhost/php-excel-file-updater/index.php
- The processed file will be generated as:
file_example_fixed.csv
index.php— Main CSV processing scriptfile_example.csv— Sample source filefile_example_fixed.csv— Generated output filefile_example.xls— Additional sample spreadsheet included in the project
This project is licensed under the MIT License.