Nansh has asked for the wisdom of the Perl Monks concerning the following question:
Hi my code is like this
use strict; use Spreadsheet::ParseXLSX; use Spreadsheet::WriteExcel; my $pattern="Name"; my $parser = Spreadsheet::ParseXLSX->new(); my $workbook = $parser->parse('somthing.xlsx'); if ( !defined $workbook ) { die $parser->error(), ".\n"; } for my $worksheet ( $workbook->worksheets() ) { 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; if($cell->value eq $pattern) { //Here How to get the complete row info if $info equal to $pat +tern// } } } }
I need to get whole row if Name is found in the XLSX file
Thank you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XLSX retriving if matches
by runrig (Abbot) on Jun 16, 2017 at 17:02 UTC | |
|
Re: XLSX retriving if matches
by 1nickt (Canon) on Jun 16, 2017 at 16:27 UTC | |
|
Re: XLSX retriving if matches
by marinersk (Priest) on Jun 17, 2017 at 02:52 UTC |