Home  >  Article  >  Backend Development  >  Is some data imported into phpexcel incorrect?

Is some data imported into phpexcel incorrect?

WBOY
WBOYOriginal
2016-08-04 09:19:541015browse

Why not everything is wrong, only some errors are found:
Excel looks like this

Is some data imported into phpexcel incorrect?
This is what it looks like after inserting into the database

Is some data imported into phpexcel incorrect?
There are more than a thousand pieces of data in total. No matter how I import it, there are always a few errors. What is the cause? Really weird.
Can anyone remind me? Thank you in advance~

Reply content:

Why not everything is wrong, only some errors are found:
Excel looks like this

Is some data imported into phpexcel incorrect?
This is what it looks like after inserting into the database

Is some data imported into phpexcel incorrect?
There are more than a thousand pieces of data in total. No matter how I import it, there are always a few errors. What is the cause? Really weird.
Can anyone remind me? Thank you in advance~

It has been solved. phpexcel itself uses "," to splice the read data

Is some data imported into phpexcel incorrect?

Change it to another splicing character and it will be normal, there will be no conflict

Thank you for the invitation. I guess there are invisible special characters or special formats in the data in your excel file. I would like to give you a suggestion: filter the corresponding data you want to store into the database by filtering special characters, such as line breaks, spaces, etc. For reference only

Is there a problem with recognizing the separator~ Commas are used as identifiers in CSV. It is recommended that you take a look at the source code to see how phpexcel is implemented.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn