Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Paul M Foster
On Fri, Mar 19, 2010 at 06:01:38PM -0400, Jason Pruim wrote: > > But if you have a decent CASS software then it should add the zip back > in hehe :) For the sake of those in Europe and elsewhere, CASS software is software certified by the US Postal Service which cleans up addresses to conform t

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Paul M Foster
On Fri, Mar 19, 2010 at 10:13:54PM +, Ashley Sheridan wrote: > > It's not really just that. In the csv format, a field value of 00123 (I don't > really know what zip code formats are) is perfectly valid. ZIP codes are simply five digits. The starting digit (0-9) identifies a broad region

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:13 PM, Ashley Sheridan wrote: > > On Fri, 2010-03-19 at 18:01 -0400, Jason Pruim wrote: > > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > > > On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan > > wrote: > > [snip] > >> And I believe that when MS Office saves a CSV

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:01 PM, Jason Pruim wrote: > > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > >> On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan >> wrote: >> [snip] >>> >>> And I believe that when MS Office saves a CSV out with a character other >>> than a comma as the delimiter,

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Ashley Sheridan
On Fri, 2010-03-19 at 18:01 -0400, Jason Pruim wrote: > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > > > On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan > > wrote: > > [snip] > >> And I believe that when MS Office saves a CSV out with a character > >> other > >> than a comma as the de

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Jason Pruim
On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan wrote: [snip] And I believe that when MS Office saves a CSV out with a character other than a comma as the delimiter, it still saves it as a .csv by default. Nope. If you save as CSV, it i

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
On Thu, Mar 18, 2010 at 05:00:24PM +, Ashley Sheridan wrote: > On Thu, 2010-03-18 at 12:57 -0400, Paul M Foster wrote: > > On Thu, Mar 18, 2010 at 04:15:33PM +, Ashley Sheridan wrote: > > > On Thu, 2010-03-18 at 12:12 -0400, Paul M Foster wrote: > > > > On Thu, Mar 18

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Andrew Ballard
On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan wrote: [snip] > And I believe that when MS Office saves a CSV out with a character other > than a comma as the delimiter, it still saves it as a .csv by default. Nope. If you save as CSV, it is comma-separated with double-quotes as the text qualifi

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 12:57 -0400, Paul M Foster wrote: > On Thu, Mar 18, 2010 at 04:15:33PM +, Ashley Sheridan wrote: > > > On Thu, 2010-03-18 at 12:12 -0400, Paul M Foster wrote: > > > > On Thu, Mar 18, 2010 at 08:57:00AM -0700, Tommy Pham wrote: > > > > > > > > > > > >

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
On Thu, Mar 18, 2010 at 04:15:33PM +, Ashley Sheridan wrote: > On Thu, 2010-03-18 at 12:12 -0400, Paul M Foster wrote: > > On Thu, Mar 18, 2010 at 08:57:00AM -0700, Tommy Pham wrote: > > > > > > > Personally, I find working with fixed widths is best. The text file > >

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
On Thu, Mar 18, 2010 at 09:16:30AM -0700, Mattias Thorslund wrote: > Paul M Foster wrote: >> I process a lot of CSV files, and what I typically see is that Excel >> will enclose fields which might contain commas in quotes. This gets >> messy. So I finally wrote a C utility which parses the file an

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 12:12 -0400, Paul M Foster wrote: > On Thu, Mar 18, 2010 at 08:57:00AM -0700, Tommy Pham wrote: > > > > > > > Personally, I find working with fixed widths is best. The text file > > might be larger but I don't have worry about escaping any type of > > characters ;) > >

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Mattias Thorslund
Paul M Foster wrote: I process a lot of CSV files, and what I typically see is that Excel will enclose fields which might contain commas in quotes. This gets messy. So I finally wrote a C utility which parses the file and yields tab-delimited records without the quotes. Paul And fgetcsv() d

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
On Thu, Mar 18, 2010 at 08:57:00AM -0700, Tommy Pham wrote: > > Personally, I find working with fixed widths is best. The text file > might be larger but I don't have worry about escaping any type of > characters ;) I find this impossible, since I never know the largest width of all the field

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Tommy Pham
On Thu, Mar 18, 2010 at 8:40 AM, tedd wrote: > At 11:35 AM + 3/18/10, Ashley Sheridan wrote: >> >> 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.

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread tedd
At 11:35 AM + 3/18/10, Ashley Sheridan wrote: 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

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Jochen Schultz
AFAIK, there is no real standard out there for CSV file definition and since Microsoft and many others (me too btw) use other chars for field separation in so called CSV files, i think it is a good way to deal with it and let it be how it is (actually i have to look into every CSV file that is

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
On Thu, Mar 18, 2010 at 11:35:33AM +, Ashley Sheridan wrote: > > 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 w

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Jochen Schultz
> 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'! Or maybe it is because someone told them, that there

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 12:56 +0100, Jochen Schultz wrote: > > 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 separ

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Ashley Sheridan
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 > wrote: > > > On Tue, 2010-03-16 at 20:16 +0800, I am on the t

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-16 Thread Jochen Schultz
Or maybe you want to check out this: http://www.codeplex.com/PHPExcel I havn't checked it out for your special purpose but i found it useful for some other jobs (especially excell 2007 support). regards Jochen Ashley Sheridan schrieb: On Tue, 2010-03-16 at 20:16 +0800, I am on the top of th

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-16 Thread Ashley Sheridan
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->setOutputEnco

[PHP] Spreadsheet_Excel_Reader problem

2010-03-16 Thread I am on the top of the world! Borlange University
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]['c