in reply to Re^3: Read excel column and compare with array
in thread Read excel column and compare with array
TY#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Spreadsheet::Read; use Spreadsheet::XLSX; use Text::Iconv; my $converter = Text::Iconv -> new ("utf-8", "windows-1251"); my $excel = Spreadsheet::XLSX -> new ('C:/SLB/Dashboard/DCSS_Applicati +ons.xlsx', $converter); my @DCSS_ss; foreach my $sheet (@{$excel -> {Worksheet}}) { printf("Sheet: %s\n", $sheet->{Name}); $sheet -> {MaxRow} ||= $sheet -> {MinRow}; foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { $sheet -> {MaxCol} ||= $sheet -> {MinCol}; my $cell = $sheet -> {Cells} [$row] [2]; s/^\s+|\s+$//g for $cell->{Val}; if ($cell) { push @DCSS_ss, { SSRID =>$cell -> {Val} }; } } } print Dumper \@DCSS_ss;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Read excel column and compare with array
by thanos1983 (Parson) on Jul 17, 2017 at 10:47 UTC | |
by snehit.ar (Beadle) on Jul 17, 2017 at 11:17 UTC | |
by thanos1983 (Parson) on Jul 17, 2017 at 15:24 UTC | |
by snehit.ar (Beadle) on Jul 18, 2017 at 05:57 UTC |