<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Uma coisa, eu usei no meu if apenas o
      n&uacute;mero, mas existem n&uacute;meros da faixa 5 que s&atilde;o telefones fixos, se
      quiser acrescente um outro if pegando algum outro campo<br>
      <br>
      Em 31-07-2012 11:01, Mike Tesliuk escreveu:<br>
    </div>
    <blockquote cite="mid:5017E547.2040900@tesliuk.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">tente desta forma<br>
        <br>
        #!/usr/bin/perl<br>
        # Salve este arquivo e execute ele da seguinte forma<br>
        # perl &lt;este_arquivo&gt; &lt;arquivo_de_BDD&gt;<br>
        <br>
        @ARGV;<br>
        <br>
        <br>
        open FILE, "$ARGV[0]";<br>
        <br>
        while(&lt;FILE&gt;){<br>
        &nbsp;&nbsp;&nbsp; chomp($_);<br>
        &nbsp;&nbsp;&nbsp; my @nvalues = split(";", $_);<br>
        &nbsp;&nbsp;&nbsp; my $number = $nvalues[2];<br>
        &nbsp;&nbsp;&nbsp; #print $number . "\n";<br>
        &nbsp;&nbsp;&nbsp; if($number =~ m/11[5-9][0-9]{7}/){<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ddd = substr($number, 0, 2);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $nnumber = substr($number, 2, 8);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ninedigit = $ddd . "9" . $nnumber;<br>
        <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #print "NUMERO NOVO: $ninedigit\n";<br>
        &nbsp;&nbsp;&nbsp; }else{<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ninedigit = $number;<br>
        &nbsp;&nbsp;&nbsp; }<br>
        <br>
        &nbsp;&nbsp;&nbsp; $asize = scalar @nvalues;<br>
        &nbsp;&nbsp;&nbsp; #print "Tamanho: $asize\n";<br>
        &nbsp;&nbsp;&nbsp; for ($i = 0; $i &lt; @nvalues; $i++){<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if($i != 2){<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print @nvalues[$i] . ";";<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print $ninedigit . ";";<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if($i == ($asize -1)){<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "\n";<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
        &nbsp;&nbsp;&nbsp; }<br>
        }<br>
        <br>
        <br>
        close FILE;<br>
        <br>
        <br>
        Em 31-07-2012 10:49, Rodrigo Lang escreveu:<br>
      </div>
      <blockquote
cite="mid:CAJDn30e8L=HB5QoQkqXmzFhP_-o-74iJR=gKqx+-+4yma8LMkA@mail.gmail.com"
        type="cite">Sim, assim ir&aacute; funcionar...
        <div><br>
        </div>
        <div><br>
        </div>
        <div>S&oacute; n&atilde;o utilize a que eu te passei, pois ela est&aacute; errada,
          ela ir&aacute; substituir tudo que cont&eacute;m ";11" de 6 &agrave; 9 mais 7
          d&iacute;gitos por apenas ";119". Erro meu, desculpa.</div>
        <div><br>
        </div>
        <div>Voc&ecirc; s&oacute; ir&aacute; ter que fazer manualmente para ";119", ";118",
          etc..</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>At,</div>
        <div>Rodrigo Lang.<br>
          <br>
          <div class="gmail_quote">Em 31 de julho de 2012 10:46, <a
              moz-do-not-send="true" href="mailto:monica@addphone.net">monica@addphone.net</a>
            <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:monica@addphone.net" target="_blank">monica@addphone.net</a>&gt;</span>
            escreveu:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#3333FF"> eu estou fazendo
                com SED mesmo, estou retirando a 1&ordm; string e o que esta
                depois da hora na modifica&ccedil;ao<br>
                <br>
                assim toda linha que que contem ;119 posso trocar por
                ;1199 e ai blz, pois nem outro campo do arquivo tem esta
                ocorrencia
                <div>
                  <div class="h5"><br>
                    <br>
                    <br>
                    <br>
                    <div>On 7/31/2012 10:41 AM, Rodrigo Lang wrote:<br>
                    </div>
                    <blockquote type="cite">Monica, est&aacute; utilizando o
                      vi/vim para editar esse arquivo?
                      <div><br>
                      </div>
                      <div>Se sim, de acordo com o padr&atilde;o que voc&ecirc;
                        mostrou ( ";&lt;DDD&gt;&lt;N&uacute;mero&gt;;" )digite
                        dois pontos e:</div>
                      <div><br>
                      </div>
                      <div>%s/;11[6-9]{7}/;119/g</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>Sugiro que fa&ccedil;a um backup do arquivo antes.</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>At,</div>
                      <div>Rodrigo Lang.<br>
                        <div><br>
                        </div>
                        <div><br>
                          <div class="gmail_quote">Em 31 de julho de
                            2012 10:19, <a moz-do-not-send="true"
                              href="mailto:monica@addphone.net"
                              target="_blank">monica@addphone.net</a> <span
                              dir="ltr">&lt;<a moz-do-not-send="true"
                                href="mailto:monica@addphone.net"
                                target="_blank">monica@addphone.net</a>&gt;</span>
                            escreveu:<br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex">
                              <div bgcolor="#FFFFFF" text="#3333FF"> Bom
                                dia, bom, como todos j&aacute; sabem ontem
                                entrou em vigor a altera&ccedil;&atilde;o dos
                                celulares de SP<br>
                                Preciso alterar minha base de dados para
                                adicionar o 9<br>
                                <br>
                                meu arquivo de n&uacute;meros esta assim<br>
                                <br>
                                6917078;21652957;1188484474;55341;0341;498;07/07/2012


                                21:00:59;lspp;new;Basic;;07/07/2012
                                21:00:58;INSERT;<br>
                                6917082;21652955;1168798090;55341;0341;498;07/07/2012


                                21:00:59;lspp;new;Basic;;07/07/2012
                                21:00:58;INSERT;<br>
                                6917083;21652962;1198848449;55341;0341;498;07/07/2012


                                21:01:00;lspp;new;Basic;;07/07/2012
                                21:00:59;INSERT;<br>
                                6917085;21652964;1178484502;55341;0341;498;07/07/2012


                                21:01:00;lspp;new;Basic;;07/07/2012
                                21:00:59;INSERT;<br>
                                <br>
                                <br>
                                estou tentando usando express&atilde;o regular
                                e SED.<br>
                                <br>
                                A express&atilde;o regular para encontrar s&oacute; os
                                n&uacute;meros de SP j&aacute; criei, agora falta como
                                colocar este maldito 9 na frente.<br>
                                <br>
                                Obrigada<br>
                              </div>
                              <br>
_______________________________________________<br>
                              KHOMP Inova&ccedil;&atilde;o: External Board Series<br>
                              M&oacute;dulos de 1/2 rack e 1U para todas as
                              interfaces e solu&ccedil;&otilde;es Asterisk e
                              FreeSWITCH.<br>
                              Tenha a External Series Experience na sua
                              aplica&ccedil;&atilde;o. Visite&nbsp;<a
                                moz-do-not-send="true"
                                href="http://www.khomp.com"
                                target="_blank">www.khomp.com</a><br>
_______________________________________________<br>
                              DIGIVOICE &nbsp;Fabricante de Placas de Voz e
                              Channel Bank<br>
                              20 anos de experi&ecirc;ncia com E1(R2/ISDN),
                              FXS, FXO e GSM<br>
                              Centro Treinamento - Curso de PABX IP -
                              &nbsp;Asterisk &nbsp;- Site &nbsp;<a
                                moz-do-not-send="true"
                                href="http://www.digivoice.com.br"
                                target="_blank">www.digivoice.com.br</a><br>
                              ________<br>
                              YEALINK: Telefones IP e V&iacute;deoPhones IP com
                              o melhor custo/benef&iacute;cio do mercado.<br>
                              email: <a moz-do-not-send="true"
                                href="mailto:yealink@commlogik.com.br"
                                target="_blank">yealink@commlogik.com.br</a>
                              | <a moz-do-not-send="true"
                                href="http://www.commlogik.com.br"
                                target="_blank">www.commlogik.com.br</a>
                              | (11) 5503-1011<br>
______________________________________________<br>
                              Para remover seu email desta lista, basta
                              enviar um email em branco para <a
                                moz-do-not-send="true"
                                href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org"
                                target="_blank">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a><br>
                            </blockquote>
                          </div>
                          <br>
                          <br clear="all">
                          <div><br>
                          </div>
                          -- <br>
                          Rodrigo Lang<br>
                          <br>
                        </div>
                      </div>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
              <br>
              _______________________________________________<br>
              KHOMP Inova&ccedil;&atilde;o: External Board Series<br>
              M&oacute;dulos de 1/2 rack e 1U para todas as interfaces e
              solu&ccedil;&otilde;es Asterisk e FreeSWITCH.<br>
              Tenha a External Series Experience na sua aplica&ccedil;&atilde;o.
              Visite&nbsp;<a moz-do-not-send="true"
                href="http://www.khomp.com" target="_blank">www.khomp.com</a><br>
              _______________________________________________<br>
              DIGIVOICE &nbsp;Fabricante de Placas de Voz e Channel Bank<br>
              20 anos de experi&ecirc;ncia com E1(R2/ISDN), FXS, FXO e GSM<br>
              Centro Treinamento - Curso de PABX IP - &nbsp;Asterisk &nbsp;- Site
              &nbsp;<a moz-do-not-send="true"
                href="http://www.digivoice.com.br" target="_blank">www.digivoice.com.br</a><br>
              ________<br>
              YEALINK: Telefones IP e V&iacute;deoPhones IP com o melhor
              custo/benef&iacute;cio do mercado.<br>
              email: <a moz-do-not-send="true"
                href="mailto:yealink@commlogik.com.br">yealink@commlogik.com.br</a>
              | <a moz-do-not-send="true"
                href="http://www.commlogik.com.br" target="_blank">www.commlogik.com.br</a>
              | (11) 5503-1011<br>
              ______________________________________________<br>
              Para remover seu email desta lista, basta enviar um email
              em branco para <a moz-do-not-send="true"
                href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a><br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          Rodrigo Lang<br>
          <br>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
KHOMP Inova&ccedil;&atilde;o: External Board Series
M&oacute;dulos de 1/2 rack e 1U para todas as interfaces e solu&ccedil;&otilde;es Asterisk e FreeSWITCH.
Tenha a External Series Experience na sua aplica&ccedil;&atilde;o. Visite&nbsp;<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.khomp.com">www.khomp.com</a>
_______________________________________________
DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
20 anos de experi&ecirc;ncia com E1(R2/ISDN), FXS, FXO e GSM
Centro Treinamento - Curso de PABX IP -  Asterisk  - Site  <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.digivoice.com.br">www.digivoice.com.br</a>
________
YEALINK: Telefones IP e V&iacute;deoPhones IP com o melhor custo/benef&iacute;cio do mercado.
email: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:yealink@commlogik.com.br">yealink@commlogik.com.br</a> | <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.commlogik.com.br">www.commlogik.com.br</a> | (11) 5503-1011
______________________________________________
Para remover seu email desta lista, basta enviar um email em branco para <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a></pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
KHOMP Inova&ccedil;&atilde;o: External Board Series
M&oacute;dulos de 1/2 rack e 1U para todas as interfaces e solu&ccedil;&otilde;es Asterisk e FreeSWITCH.
Tenha a External Series Experience na sua aplica&ccedil;&atilde;o. Visite&nbsp;<a class="moz-txt-link-abbreviated" href="http://www.khomp.com">www.khomp.com</a>
_______________________________________________
DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
20 anos de experi&ecirc;ncia com E1(R2/ISDN), FXS, FXO e GSM
Centro Treinamento - Curso de PABX IP -  Asterisk  - Site  <a class="moz-txt-link-abbreviated" href="http://www.digivoice.com.br">www.digivoice.com.br</a>
________
YEALINK: Telefones IP e V&iacute;deoPhones IP com o melhor custo/benef&iacute;cio do mercado.
email: <a class="moz-txt-link-abbreviated" href="mailto:yealink@commlogik.com.br">yealink@commlogik.com.br</a> | <a class="moz-txt-link-abbreviated" href="http://www.commlogik.com.br">www.commlogik.com.br</a> | (11) 5503-1011
______________________________________________
Para remover seu email desta lista, basta enviar um email em branco para <a class="moz-txt-link-abbreviated" href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a></pre>
    </blockquote>
    <br>
  </body>
</html>