Using PHP to resolve execl problems? + Urgent

Source: Internet
Author: User
Use PHP to parse execl problem? + Urgent urgent and urgent urgent
My PHP parsing execl I use the Php-excel-reader tool to parse, but I am now the case is this
Problem one: When I read execl, I found that the execl that I read was marked with an asterisk (*), so when I was in the database, it was
There are asterisks, I think the way is to read out the asterisk, with a space instead, but in the database, still no, do not know whether it is me
The alternative position is not written in the wrong place.

Issue two: Focus
The customer gives the execl inside points up and down 2 parts, above is a table of data, the following is another table in the data, so is the next parse here Execl, to the execl above the data corresponding to the corresponding table, the following contents, stored in the corresponding table, that is

EXECL:

Above: The contents of a table

Below: contents of table B

Now the data that is parsed into the execl is stored in the corresponding table. PHP parsing execl

Share to:


------Solution--------------------
Excel is not parsed with PHP

But if you're in a hurry, and if the number of Excel tables given by the client is limited,

You can use the Navicat software to save the table directly to the database and then use PHP to operate

That's what I did before, bypassing what I don't understand .... Although it is not good for the technical improvement but for the pursuit of results is very effective ...

Another: Navicat import function is very powerful ...
------Solution--------------------
1) You read the Excel data through PHP, remove the table header row of data, then the rest is the actual data, according to determine whether there is a * number, replace can.
2) You can store the contents of the top and bottom tables in two different Excel and read the information separately.
------Solution--------------------
The second problem, the best way is a sheet save a table of data, so the import is easier to explain. If you really want to save two tables of data in a sheet, then you can also define the separation conditions (such as two tables in the middle of the empty 2 rows), and then loop through the rows, to determine whether the row is delimited rows, after separating the row is the data of the second table.
------Solution--------------------
Do not understand your code, suggest: Imported Excel table, must be in the specified format, and this format must be the program can be interpreted, and then in the program to interpret the data you want to.
------Solution--------------------
That neither the code nor the data file is given
I had to do 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 be able to see, right?!
------Solution--------------------
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.