in reply to Re: Excel Text parsing problem
in thread Excel Text parsing problem
Here you go
But the text line gives an output as below
8:1----8:2---- 8:3---- 8:4---- 8:7----8:8----
For the same code, the text line is not able to read the name (LWSHI1C) or any of the above values, it only reads certain columns .. Dont know why...
When the print line is executed it gives an output type: Row, Col = (8, 1) Value = LWSHI1C Row, Col = (8, 2) Value = 900 Row, Col = (8, 4) Value = 2 Row, Col = (8, 5) Value = Row, Col = (8, 6) Value = 3use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse($filename); if ( !defined $workbook ) { die $parser->error(), ".\n"; } for my $worksheet ( $workbook->worksheet(1) ) { my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); next unless $cell; print "Row, Col = ($row, $col)\n"; print "Value = ", $cell->value(), "\n"; print "\n"; $txt->insert('end', "$row:$col----$worksheet->{Cells}[$row][$col]->{ +Val}\n"); } } }
But the text line gives an output as below
8:1----8:2---- 8:3---- 8:4---- 8:7----8:8----
For the same code, the text line is not able to read the name (LWSHI1C) or any of the above values, it only reads certain columns .. Dont know why...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Excel Text parsing problem
by grizzley (Chaplain) on Nov 08, 2012 at 09:01 UTC | |
by reaper9187 (Scribe) on Nov 08, 2012 at 09:47 UTC | |
by grizzley (Chaplain) on Nov 08, 2012 at 10:39 UTC |
In Section
Seekers of Perl Wisdom