Re: Spreadsheet_Excel_Reader problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-03-18 at 19:21 +0800, I am on the top of the world!
Borlange University wrote:
> sounds good, i havnt checked out it with cvs format.
>  
> thanks
> 
> 
> On Tue, Mar 16, 2010 at 8:15 PM, Ashley Sheridan
> <ash@xxxxxxxxxxxxxxxxxxxx> wrote:
> 
>         
>         On Tue, 2010-03-16 at 20:16 +0800, I am on the top of the
>         world! Borlange University wrote: 
>         
>         > i have a problem of reading values from excel file via
>         > spreadsheet_excel_reader which is a php class used to manipulate excel
>         > files.
>         > 
>         > $data = new Spreadsheet_Excel_Reader();
>         > $data->setOutputEncoding('CP936');
>         > $data->read("d:\\tmp.xls");
>         > $rows=$data->sheets[0]['numRows'];
>         > $cell = $data->sheets[0]['cells'][1][1];
>         > 
>         > if i type many rows,say 1000, in the tmp.xls, it can read, $rows shows 1000,
>         > however, 1000 rows of data are copied from another excel file and these
>         > cells may have different background or other changes that differ from normal
>         > cells, it fails to read.the variable $rows shows nothing....what i can do
>         > now is to split these data into small groups, small enough to be read, it
>         > really takes plenty of time.
>         > 
>         > 
>         > i dont know why, has somebody met this problem ever?
>         
>         
>         
>         
>         If it's just the data you need, try using a csv file instead.
>         The Excel format is closed, and as such, the PHP classes won't
>         have full support for all of it's features. It seems like
>         formatting is causing the data to be written to the
>         spreadsheet differently maybe. 
>         
>         
>         
>         Thanks,
>         Ash
>         http://www.ashleysheridan.co.uk
>         
>         
>         
> 
> 


The .csv format is just a plain text format, so you won't get formatting
or formulas in your 'sheets' (csv is also a sheetless format) but it's
been used for years by many systems for data.

A lot of database systems will let you import csv files as well, which
is quite convenient, although you will have to make sure the csv uses
commas to delimit the data. Microsoft managed to basterdise this format
a bit as well, and lets you use tabs, spaces and all sorts of other
characters to delimit data fields. Someone obviously didn't mention to
them that the file type is 'comma separated values'!

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux