Recommend this page to a friend! |
Classes of Sergii Pryz | PHP CSV Import to MySQL | README.md | Download |
|
DownloadImportCsvUserMasterDevImportCsvUser is a console application to help import User's data from CSV (comma separated value) to MySQL. Project is working for specific CSV structure where first row acts as a schema. Additionally ImportCsvUser has:
RequirementsInstall
UsageImportCsvUser supports commands: * _Note_: all example command SHOULD be run inside user:import-csvPlease execute Example 1In that example is importing valid user file. Please execute:
As execution result:
Example 2In that example file contains some invalid rows. Please execute command:
As execution result:
user:age-averagePlease run Example 1Please execute command:
As execution result:
File formatFile SHOULD has delimiter Table bellow describes column name. name/characteristics | firstname | infix | lastname | date of birth | gender | zipcode | housenumber --- | --- | --- | --- | --- | --- | --- | --- required | yes | no | no | no | no | no | no has normalizers | no | no | no | no | tim, lowercase | trim, uppercase | no data type | String[2-255] | String[0-45] | String[0-255] | Date[Y-m-d] | String['m', 'f'] | String[0-32] | String[0-255] example | Nick | ter | Tester | 1991-08-24 | m | 12010 | 9b _Note_: column name SHOULD start form alphabetic character. It case if it's present some non alphabetic character it will be
remove and application try to map columns with sanitized column name. For instance if the original column name Skipped rowsRows that has first column started with NormalizersNormalizers helps to clean users data of get the right format. Here is a normalizer list:
ValidatorsThe data validators skip rows and write the report result with keeping process running. There is a list of validators:
Documentation
ContributionIf you find this project worth to use please add a star. Follow changes to see all activities. And if you see room for improvement, proposals please feel free to create an issue or send pull request. Here is a great guide to start contributing. Please note that this project is released with a Contributor Code of Conduct. By participating in this project and its community you agree to abide by those terms. LicenseImportCsvUser is licensed under the MIT License. Please see the LICENSE file for details. |