dimanche 29 juillet 2018

Import csv using index matching for Laravel

I am thinking of using an index matching while uploading the csv file to the database. So something like, we have a string 'index_to_match [ 'A', 'D', 'C', 'F', 'B', 'E' ]' which are the horizontal index of the csv file (the coloumns of a csv file) and a database table with the following fields, field1, field2, field3, field4, field5 and field6. Now the data in the coloumn "A" will get inserted to field1, the data in coloumn 'D' will get inserted to field2, the data in coloumn 'C' will get inserted to field3 and so on. There are ways to implement this is python, so is there anyway I can do this is laravel?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire