Variables to read from Excel sheet :
isim =
usim =
sim_invalid =
pcscf_discovery_flag
signaling_flag
ran_type
emergency_ind
rat
pcscf_v4
pcscf_v6
plmn
is_ems_support
ipv4
ipv6
####
My input data to search from:
8077 8116 D type hexa usim = 1, isim = 1
8077 8116 D type hexa usim = 1, isim = 1
pcscf_v4 : num = 2, protocol_type = 0x21, port_num = 0, addr = 10.56.5.85
8088 1223 D temp sim_invalid = 0
8099 1223 XX is_ems_support = 1 #88
8099 1224 XX pdn_act_ind->pcscf_discovery_flag = 1
ind->signaling_flag = 1
some text here plmn = 405872
DefaultStatusBarPlmnPlugin: into updateCarrierLabel
ipv6 = 36.5.2.4.25.143.200.141.0.0.0.0.32.20.232.161
get_ipv6_prefix,temp
ipv4 = 10.167.185.101
_send_ipv4_notify
####
#use strict;
#use 5.010;
use Spreadsheet::Read qw(ReadData);
my $book = ReadData ('UE_NW_Parameters.xlsx');
#my @files = grep { -f } (<*.txt>,<*main_log>,<*Project>,<*properties>);
my @files = grep { -f } (<*main_log>);
my @rows = Spreadsheet::Read::rows($book->[1]);
foreach my $i (1 .. scalar @rows) {
foreach my $j (1 .. scalar @{$rows[$i-1]}) {
my $temp = "\n$rows[$i-1][$j-1]";
my @keywords = "$temp";
print @keywords;
}
foreach my $file (@files){
open(my $fh, '<', $file) or die $!;
my @content = <$fh>;
close($fh);
my $l = 0;
foreach my $kw (@keywords)
{
foreach (@content){
$l++;
my $search = $kw;
if ($search =~ /(\ d+)/)
{
printf 'Found keyword %s in file %s, line %d:%s'.$/, $search, $file, $l, $_;
last;
}
}
}
}
}