Hi jZed,
I assumed the following Code but it seems vague and there is some real problem with it. I am not able to implement Regular Expressions Logic. Other things are also messed up.
As such, can you please explain the Logic you mentioned in your Algo by giving your own Actual Perl Script for the Scenario.
#!/usr/bin/perl -w
#List.plx
$file_name="/home/Wireless/kkiran/PERL/Files";
$files="file_name1, file_name2, file_name3";
$file_name1="BSC";
$file_name2="SBSCSubsystem";
$file_name3="MCBTS";
$dir_name = "/home/Wireless/kkiran/PERL";
@files=`ls -prt $file_name |grep -v / `;
# Extract all files with the date file_name1.20041204********* and pla
+ce in the file named BSC.
$count=0, max_count;
foreach $eachline(@file_name1.20041204*********)
{
chomp($eachline);
print"\n$eachline";
}
for (count=1; count=max_count;count++)
{
print "BSC.20041204*********\n : $file_name1.20041204*********\n";
}
if($count > max_count)
{
return(0);
}
exit;
# Extract all files with the date file_name2.20041204********* and pla
+ce in the file
named SBSCSubsystem.
$count=0, max_count;
foreach $eachline(@file_name2.20041204*********)
{
chomp($eachline);
print"\n$eachline";
}
for (count=1; count=max_count;count++)
{
print "SBSCSubsystem.20041204*********\n : $file_name2.20041204*******
+**\n";
}
if($count > max_count)
{
return(0);
}
exit;
# Extract all files with the date file_name3.20041204********* and pla
+ce in the file named MCBTS.
$count=0, max_count;
foreach $eachline(@file_name3.20041204*********)
{
chomp($eachline);
print"\n$eachline";
}
for (count=1; count=max_count;count++)
{
print "MCBTS.20041204*********\n : $file_name3.20041204*********\n";
}
if($count > max_count)
{
return(0);
}
exit;