0

I am having two files names as a.html a.xml in a folder and in a.html file i have a tag

<div class="snippet abstract">
We present a new "model" for multiple-input-multiple-output (MIMO) outdoor wireless fading channels "and" their capacity performance. The proposed model is more general and realistic than the usual independent and identically distributed (i.i.d.) model, and allows us to investigate the "behavior" of channel capacity as a function of the scattering radii at transmitter and receiver, distance between the transmit and receive arrays, and antenna beamwidths and spacing. We show how the MIMO capacity is governed by spatial fading correlation and the condition number of the channel matrix through specific sets of propagation parameters. The proposed model explains the existence of "pinhole" channels which exhibit low spatial fading correlation at both ends of the link but still have poor rank properties, and hence, low ergodic capacity. In fact, the model suggests the existence of a more general family of channels spanning continuously from full rank i.i.d. to low-rank pinhole cases. We suggest guidelines for predicting high rank (and hence, high ergodic capacity) in MIMO channels, and show that even at long ranges, high channel rank can easily be sustained under mild scattering conditions. Finally, we validate our results by simulations using ray tracing techniques. Connections with basic antenna theory are made.
<div><a href="dfgfs">Full Abstract</a>

I have to replace the double quotes inside the tags as below

 <div class="snippet abstract">
We present a new x#&201C;modelx#&201D; for multiple-input-multiple-output (MIMO) outdoor wireless fading channels x#&201C;andx#&201D; their capacity performance. The proposed model is more general and realistic than the usual independent and identically distributed (i.i.d.) model, and allows us to investigate the x#&201C;behaviorx#&201D; of channel capacity as a function of the scattering radii at transmitter and receiver, distance between the transmit and receive arrays, and antenna beamwidths and spacing. We show how the MIMO capacity is governed by spatial fading correlation and the condition number of the channel matrix through specific sets of propagation parameters. The proposed model explains the existence of x#&201D;pinholex#&201D; channels which exhibit low spatial fading correlation at both ends of the link but still have poor rank properties, and hence, low ergodic capacity. In fact, the model suggests the existence of a more general family of channels spanning continuously from full rank i.i.d. to low-rank pinhole cases. We suggest guidelines for predicting high rank (and hence, high ergodic capacity) in MIMO channels, and show that even at long ranges, high channel rank can easily be sustained under mild scattering conditions. Finally, we validate our results by simulations using ray tracing techniques. Connections with basic antenna theory are made.
<div><a href="sdffdf">Full Abstract</a>

But i should replace for the text which is between the

 <div class="snippet abstract">

    <div><a href="/xpl/articleDetails.jsp?

only.

4
  • I am trying the find and replace command using the [>][^<]*" regular expression to replace but i am not able to figure it out Oct 29, 2013 at 7:29
  • any help on this Oct 30, 2013 at 5:37
  • I have done the following where i can search for the text <div class="snippet abstract"> and getting the count of how many such lines are present. so now i have to go to the next line and search for the " and replace with Unicode value. so please help me how to achieve this count=0 while read line do line1="<div class=\"snippet abstract\">" if [ "$line" == "$line1" ]; then echo "line found" count=expr $count + 1 fi done < reference.html echo $count Oct 30, 2013 at 8:25
  • I have tried this "grep -v '^<' test_ref.html | sed 's/"/\&#x021C;/g' test_ref.html" but this is replacing in the whole file but i want to replace it with in the div Nov 5, 2013 at 5:24

1 Answer 1

0

Try the below code...if any clarification let me know

use strict;
use warnings;

open(FILE,"tmp_html.html")or die "$!";



foreach(<FILE>){

        chomp($_);
        if(!(m/\=\"/)){
                $_=~s/\"/#&201C/g;
        }
        print "$_\n";

}
3
  • What about the closing quote &#201D;? And what if attribute and text appear on the same line? Nov 27, 2013 at 10:58
  • i thought &#201C is sufficient for both open and close,usually HTML tags are specified in new line...! Nov 27, 2013 at 11:16
  • No, the original poster wants different quotes for open and close. And "usually" is not a good point. Another thought: you have also to take care to not change embedded javascript and css code. Nov 27, 2013 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.