in reply to Reading Excel spreadsheets...
That information isn't stored in an Excel file. Excel only stores the maximum and minimum row and column for the entire worksheet.
If you want to find individual maximum values for a column with Spreadsheet::ParseExcel you will have to iterate through all the rows. Here is a generalised example.
#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $filename = $ARGV[0] or die "Parsing error: must specify filena +me.\n"; my $workbook = $parser->parse( $filename ); die "Parsing error: ", $parser->error(), ".\n" if !defined $workbo +ok; # Select a particular worksheet. my $worksheet = $workbook->worksheet( 0 ); # Get the worksheet cell range. my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); # Store the individual column maxima. my @col_maxes; for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); if ( defined $cell && $cell->value() ne '' ) { $col_maxes[$col] = $row; } } } # The rows and columns are zero indexed and columns that don't con +tain # data and thus don't have a maximum value will be undef. The foll +owing # prints out the data in Excel 1-indexed style. my $col_name = 'A'; for my $max ( @col_maxes ) { if ( defined $max ) { $max = $max + 1; } else { $max = 0; } print "Column '$col_name' max row = $max\n"; $col_name++; } __END__ For a spreadsheet like this: ________ _| Sheet1 |__________________________________________________ |_____________________________________________________________ +| | || | | +| | || A | B | C +| |_________||________________|________________|________________ +| | 1 || Foo | | +| |_________||________________|________________|________________ +| | 2 || | | Foo +| |_________||________________|________________|________________ +| | 3 || Foo | | +| |_________||________________|________________|________________ +| | 4 || | | Foo +| |_________||________________|________________|________________ +| Prints this: Columm 'A' max row = 3 Columm 'B' max row = 0 Columm 'C' max row = 4
--
John.
|
|---|