use strict; use warnings; use PerlIO::via::Logger; use Time::Stamp localstamp => {format => 'compact'}; use DBI; use Spreadsheet::Read; use List::MoreUtils qw(uniq); use String::Util qw(trim); use Getopt::Long; my $matchedLog; my $misMatchedLog; my $missingLog; my $timeStamp; my $tempLog; my $logging; my $logFile; my $targetDir; my $errored = 0; my $dbh; my $sth; my $sql; my $book; my $sheet; my $cell; my $callTypeID = 0; my $initCallType; my $rnaCallType; my $xfrCallType; my $rowCnt = 1; my @dbRow; my @callTypeList; my @fileList; my @fileDetails; opendir(DIR, "c:/scripts/modular_collector/collections"); while (readdir (DIR)) { # IGNORE NON XLSX FILES next if ($_ !~ m/\.xlsx$/); $rowCnt = 3; print $_ . "\n"; $book = Spreadsheet::Read->new($_, parser => "xlsx"); my $numSheets = $book->sheets; $numSheets = $numSheets - 1; print $numSheets . "\n"; $sheet = $book->sheet($numSheets); my $finished = 0; while (!$finished) { $cell = "C" . $rowCnt; $callTypeID = $sheet->cell($cell); $callTypeID = trim($callTypeID); if ($callTypeID =~ m/\d+/) { print "Call Type " . $callTypeID . "\n"; push(@callTypeList, $callTypeID); } else { $finished = 1; } $rowCnt++; } } closedir(DIR); @callTypeList = uniq(@callTypeList);