@nithinpes
Hi,
what u said is actually right!!!
Actually one is the main array and other is an array with highlighted terms.
i want to compare them and print the same.
Here is other example.
-
@arr=("TDP-43 is a highly conserved, 43-kDa RNA-binding protein implicated to play a role in transcription repression, nuclear organization, and alternative splicing","For the splicing activity, the factor has been shown to be mainly an exon-skipping promoter","Our data further evidence TDP-43 as a multifunctional RNA-binding protein for a diverse set of cellular activities.");#main array
-
-
@arr1=("TDP-43 is a highly conserved, 43-kDa RNA-binding protein implicated to play a role in transcription repression, nuclear organization, and alternative splicing","Our data further evidence TDP-43 as a multifunctional RNA-binding protein for a diverse set of cellular activities");#array to be matched
-
-
@arr2=("TDP-43 is a highly conserved, 43-kDa RNA-binding protein implicated to play a role in transcription repression, nuclear organization, and alternative splicing","Our data further evidence TDP-43 as a multifunctional RNA-binding protein for a diverse set of cellular activities")#~s/(\bRNA-binding protein\b)/<span style="background-color:#E1FF77">$1<\/span>/img;
-
-
I am comparing @arr and @arr1 if its matching substitue @arr1 with @arr2 like this:
-
-
foreach (@arr)
-
{
-
foreach $sent(@arr1)
-
{
-
if($_=~/$sent/ig)
-
{
-
foreach $sent2(@arr2)
-
{
-
$_=~s/$_/$sent2/ig;# itried wit this also
-
$_=$sent2#i tried with this also
-
}
-
}
-
print "<br> ** $_ <br>";
-
}
-
The output obtained was like this rna binding protein highlighted:
[/code]
Our data further evidence TDP-43 as a multifunctional RNA-binding protein for a diverse set of cellular activities
For the splicing activity, the factor has been shown to be mainly an exon-skipping promoter
Our data further evidence TDP-43 as a multifunctional RNA-binding protein for a diverse set of cellular activities
[/code]
The first matched sentence is getting replaced and its not getting printed at all!!!
The last matched sentence is getting replaced with the first matched sentence.
Actually the output should be like this with RNA binding protein should be highlighted( highlighted sentences):
-
TDP-43 is a highly conserved, 43-kDa RNA-binding protein implicated to play a role in transcription repression, nuclear organization, and alternative splicing
-
For the splicing activity, the factor has been shown to be mainly an exon-skipping promoter
-
Our data further evidence TDP-43 as a multifunctional RNA-binding protein for a diverse set of cellular activities
-
How do i substitute sentence?
any suggestions?
with regards
Archana