I need to add one of these to a project. Is there an an open source PHP project made for this? Don't want to reinvent the wheel.
Values in a single column represent the same type of data. Therefore a CSV file represents a table of data (with rows and columns). The default delimiter for CSV files is the comma, but any symbol can be used as a CSV delimiter, for example, a horizontal tab.
Possible implementations of what you ask for include
Quick CSV import with visual mapping
This a full implementation with a visual mapping, though it isn't themed like your picture. An example of usage is avaliable here
jQuery csv2table
This is a partial implementation it converts csv to a html table data. The remaining part would be to convert the generated table to SQL with a visual mapping
The following items are PHP partial implementations that map csv to sql without providing a visual mapping to the user.
PHP csv2sql
PHP FileImporter
PHP csv2db
PHP csv-importer
PHP csv2mysql
PHP adv_csv
PHP csv
Sometimes reinventing the wheel is good, you get what you need, and what you need only
This seems easy, first you need a csv kinda parser, but that's just too easy you can do something like:
Your task may be break down in:
1.- Import the csv : (Build an upload form, handle file extension validation.
2.- Store the csv somewhere temporarily (Store file, probably with hash instead of name so no conflicts exist
3.- Parse the csv. (http://php.net/manual/en/function.fgetcsv.php will be your friend)
4.- Two input fields, one for the parsed files and one for your map, use some sessions/javascript fancyness for adding the right columns on the fly
5.- Then store the mapped columns to real csv values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With