script shell ou perl para substituir as aspas duplas por seus unicodes


0

Estou tendo dois nomes de arquivos como a.html a.xml em uma pasta e no arquivo a.html tenho uma 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>

Eu tenho que substituir as aspas duplas dentro das tags como abaixo

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

Mas eu devo substituir pelo texto que está entre os

 <div class="snippet abstract">

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

só.


Estou tentando o localizar e substituir comando usando o [>] [^ <] *" expressão regular para substituir, mas eu não sou capaz de descobrir isso
user1345837

Qualquer ajuda sobre isso
user1345837 30/10

Fiz o seguinte, onde posso procurar o texto <div class = "snippet abstract"> e obter a contagem de quantas linhas estão presentes. então agora eu tenho que ir para a próxima linha e procurar o "e substituir pelo valor Unicode. então, por favor me ajude como atingir essa contagem = 0 enquanto lê a linha do line1 =" <div class = \ "snippet abstract \"> "if [" $ line "==" $ line1 "]; então echo" line found "count = expr $count + 1 fi concluído <reference.html echo $ count
user1345837

Eu tentei este "grep -v '^ <' test_ref.html | sed 's /" / \ & # x021C; / g' test_ref.html "mas isso está substituindo no arquivo inteiro, mas eu quero substituí-lo por O div
user1345837

Respostas:


0

Experimente o código abaixo ... se algum esclarecimento me avisar

use strict;
use warnings;

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



foreach(<FILE>){

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

}

E a citação de fechamento &#201D;? E se atributo e texto aparecerem na mesma linha?
Slaven Rezic

Eu pensei que o & # 201C é suficiente para abrir e fechar, geralmente as tags HTML são especificadas na nova linha ...!
Thiyagu ATR 27/11/13

Não, o pôster original deseja cotações diferentes para abrir e fechar. E "geralmente" não é um bom argumento. Outro pensamento: você também deve tomar cuidado para não alterar o javascript e o código CSS incorporados.
Slaven Rezic
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.