Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
What have you tried so far? –  Daniel Beck Oct 29 '13 at 7:27
    
I am trying the find and replace command using the [>][^<]*" regular expression to replace but i am not able to figure it out –  user1345837 Oct 29 '13 at 7:29
    
any help on this –  user1345837 Oct 30 '13 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 –  user1345837 Oct 30 '13 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 –  user1345837 Nov 5 '13 at 5:24

1 Answer 1

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";

}
share|improve this answer
    
What about the closing quote &#201D;? And what if attribute and text appear on the same line? –  Slaven Rezic Nov 27 '13 at 10:58
    
i thought &#201C is sufficient for both open and close,usually HTML tags are specified in new line...! –  Thiyagu ATR Nov 27 '13 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. –  Slaven Rezic Nov 27 '13 at 12:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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