What is the problem of parsing execl using php? + My php & nbsp; analysis execl & nbsp; I use the & nbsp; php-excel-reader & nbsp; Tool & nbsp; to parse, however, my current situation is: when I read execl & nbsp;, I found the problem of using php to parse execl? + Urgent
I used the php excel-reader tool to parse execl, but the current situation is as follows:
Problem 1: When I read execl, I found that the read execl contains an asterisk (*). therefore
If there is a star number, I want to replace the asterisks I read with spaces, but it still doesn't work when I store them in the database. I don't know if it's me.
..
Question 2: Key points
The execl provided by the customer is divided into the upper and lower parts, the above is the data in a table, the following is the data in another table, so when we parse the execl here, to save the data above execl to the corresponding table, and save the following content to the corresponding table, that is
Execl:
Above: Contents of Table
The content of Table B is as follows:
Now we need to save the data parsed in execl to the corresponding table .. PHP parsing execl shared:
------ Solution --------------------
Excel parsing not using php
However, if you are eager to use it, and the number of excel tables provided by the customer is very limited
You can use the navicat software to directly store the table to the database and then use PHP for operations.
I did this before, bypassing what I don't understand... although it is not good for technological improvement, it is quite effective for the pursuit of results...
In addition, navicat has powerful import functions ......
------ Solution --------------------
1) you read the excel data through PHP, except for a row of data in the header. The rest is the actual data. you can replace the number * based on your judgment.
2) you can store the content of the upper and lower tables in two different excel files and read the information separately.
------ Solution --------------------
The second problem is that a sheet stores the data of a table, which is easier to explain during import. If you want to save the data of two tables in one sheet, you can also define the separation conditions (for example, two rows are left blank in the middle of the two tables), and then process rows cyclically, determines whether rows are separated. The data in the second table is generated after the rows are separated.
------ Solution --------------------
I didn't understand your code. it is recommended that the imported excel table be in the specified format, which can be explained by the program, then explain the data you want in the program.
------ Solution --------------------
No code or data file is provided.
Let's just make an example.
$PHPExcel = new PHPExcel_Reader_Excel5();
$sheet = $PHPExcel->load('test1.xls')->getActiveSheet();
$allRow = $sheet->getHighestRow();
for($i=1; $i<=$allRow; $i++) {
if($sheet->getCell("B$i")->getValue() != '')
echo $sheet->getCell("B$i")->getValue() . ' : ' . $sheet->getCell("C$i")->getValue(), '
';
}
A: 4650000
B: 2480000
C: 2790000
D: 8370000
E: 2790000
F: 26660000
Should I see it clearly ?!
------ Solution --------------------