prinsich / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

String being truncated while reading a big file #142

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello

I'm sorry, I can't attach a file that causes a bug because of some company 
policies forbid it.
I found that the bug might be near the the line 1108.

$newstr = '';
for ($j = 0; $j < strlen($retstr); $j++) {
     $newstr = $retstr[$j].chr(0);
}
$retstr = $newstr;

I really not an expert in excel's inner file format, but I think that this code 
will truncate the string inside the $retstr variable.
I replaced the 
$newstr =  $retstr[$j].chr(0);
with
$newstr .=  $retstr[$j].chr(0);

and now everything works as it should be (at least it looks like that).

Thank you.

Dmitry.

Original issue reported on code.google.com by dklimenk...@gmail.com on 21 Feb 2012 at 3:27

GoogleCodeExporter commented 9 years ago
Thank you so much, Dmitry, I was facing same issue, which is resolved now 
thanks to your comment.

Original comment by jc.vign...@gmail.com on 22 Feb 2012 at 12:32

GoogleCodeExporter commented 9 years ago
I have this issue too but changing the line in the code made no difference.  In 
my original 2806 line 20 column file looping through the first row columns with 

$data ->val (1, $col) truncated each string by an apparently random ammount.

lopping off all but the first four rows it's fine.  Any suggestions?

Original comment by seatonan...@gmail.com on 13 Nov 2012 at 3:26

GoogleCodeExporter commented 9 years ago
Can you post a  file for me to test on?

Original comment by endar...@gmail.com on 13 Nov 2012 at 4:10

GoogleCodeExporter commented 9 years ago
Here's the file.

Original comment by seatonan...@gmail.com on 13 Nov 2012 at 5:58

Attachments: