in reply to Re: Read excel column and compare with array
in thread Read excel column and compare with array
AR-AB-1111 AR-AB-23213 AR-AB-232 AR-AB-234 AR-AB-1 AR-AB-4 AR-AB-32 AR-AB-21 AR-AB-32
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use XML::XPath; use Spreadsheet::Read; my $book = ReadData("C:/SLB/Dashboard/DCSS_Applications.xlsx"); my $sheet = $book->[1]; # first data sheet my @column = ($sheet->{cell}[3]); # 2nd column, unformatted #@column =~ s/EAR-AA-//; use feature 'say'; foreach my $row (@column) { for (@$row) { my $rowdata; #say $_ if (defined); $rowdata = @$row; say $rowdata =~ s/AR-AB-//; } }
Expected output :
1111 23213 232 234 1 4 32 21 32
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Read excel column and compare with array
by Corion (Patriarch) on Aug 08, 2017 at 08:48 UTC | |
by snehit.ar (Beadle) on Aug 08, 2017 at 08:53 UTC | |
by Corion (Patriarch) on Aug 08, 2017 at 09:45 UTC |