#!/usr/bin/perl -w
use strict;
use XML::Twig;
use Spreadsheet::XLSX;
my $twig = XML::Twig->new;
$twig->parsefile('ue_profile.xml');
my $workbook = Spreadsheet::XLSX->new('FSL_XML.xlsx');
for my $worksheet ( $workbook->worksheets() )
{
my $worksheet_name = $worksheet->{Name};
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
for my $row ( $row_min + 1 .. $row_max ) {
my @para_array;
for my $col ( $col_min .. $col_max ) {
my $cell = $worksheet->{Cells}[$row][$col];
my $cellValue = $cell->{Val};
if ($cellValue !~ /NA/i) {
push (@para_array, $cellValue);
}
}
my $value = pop(@para_array);
my $Search_Key = join('/', @para_array);
$Search_Key = "/".$Search_Key."/";
if ($Search_Key =~ m/cqiformatIndPeriodicSubbandK/i) {
print "Hello";
}
my (@model) = $twig->findnodes($Search_Key);
foreach (@model) {
$_->set_text($value);
}
}
}
####
0
1
0
0
0
25
1
3
483
0
####
1187
1189
1188
1196