Pessoal consegui<br> <br> Fiz assim: e funcionou.. porem nao sei se eh a melhor forma:<br> <br> <CODE><br> --------------------------------------------------------------------------------------------------------------------------------<br> <span style="color: rgb(255, 0, 0);">#!/usr/bin/perl</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">#</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">my $caminho= "$ENV{HOME}/perl";</span><br style="color: rgb(255, 0, 0);"> <br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">chdir ($caminho) || die "\n *** Erro no diretorio $caminho ***";</span><br style="color: rgb(255, 0, 0);"> <br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">while ($arquivo = <*.txt>)</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">{</span><br style="color: rgb(255, 0, 0);"> <br style="color: rgb(255, 0,
0);"> <span style="color: rgb(255, 0, 0);"> $arquivo=~ /(\d\d\d\d\d\d\d\d\d\d)/;</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);"> $arquivo=$1;</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);"> push(@arquivos,$arquivo);</span><br style="color: rgb(255, 0, 0);"> <br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">}</span><br style="color: rgb(255, 0, 0);"> <br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);"></span><span style="color: rgb(255, 0, 0);">my %hash;</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">foreach (@arquivos)</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">{</span><br style="color: rgb(255,
0, 0);"> <span style="color: rgb(255, 0, 0);"> $hash{$_} = 1;</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">}</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">foreach (sort keys %hash)</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);">{</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);"> print "$_\n";</span><br style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 0, 0);"> `cat $_* >$_.txt`;<br> </span><span style="color: rgb(255, 0, 0);">}</span><br style="color: rgb(255, 0, 0);"> <br> --------------------------------------------------------------------------------------------------------------------------------<br> <br> <br> E outra coisa.. queria apagar os arquivos permanecendo somente o que eu concatenei.. :)<br> <br> Obrigada pessoal<br> <img
src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/18.gif"><br> <br><br><b><i>Patty Silva <ptfzs@yahoo.com.br></i></b> escreveu:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Ola Pessoal..<br>Eu again! :)<br><br>Fiz um script para concatenar arquivo de um diretorio:<br><br><CODIGO><br>---------------------------------------------------------------------------------------------<br><span style="color: rgb(255, 0, 0);">my $caminho= "$ENV{HOME}/teste";</span><br style="color: rgb(255, 0, 0);"><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">chdir ($caminho) || die "\n *** Erro no diretorio $caminho ***";</span><br style="color: rgb(255, 0, 0);"><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">while ($arquivo = <*.txt>)</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">{</span><br style="color: rgb(255, 0, 0);"><br
style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> $InFile= $caminho.$arquivo;</span><br style="color: rgb(255, 0, 0);"> <br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> push(@arquivos,$arquivo);</span><br style="color: rgb(255, 0, 0);"><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">}</span><br style="color: rgb(255, 0, 0);"><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">system(`cat @arquivos>>$data_out.tmp`);</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">unlink(@arquivos);</span><br><br>---------------------------------------------------------------------------------------------<br><br>Porem quero concatenar arquivos com a msm data ou seja, <br>os nomes dos arquivos sao ANOMESDIAHORA_tipo.txt<br>Quero concatenar arquivos com ANOMESDIAHORA iguais.. e gerar somente um ANOMESDIA.txt <br><br>Se alguem puder me dar uma lUz
:)<br><br>Obrigada<br><img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/03.gif"><br><br><br><div> </div><hr size="1"> Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. <a href="http://us.rd.yahoo.com/mail/br/tagline/mobile_alerts/*http://br.mobile.yahoo.com/mailalertas/">Registre seu aparelho agora!</a>_______________________________________________<br>Cascavel-pm mailing list<br>Cascavel-pm@pm.org<br>http://mail.pm.org/mailman/listinfo/cascavel-pm</blockquote><br><p> 
                <hr size=1>
Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar seu conhecimento? Experimente o <a href="http://us.rd.yahoo.com/mail/br/tagline/answers/*http://br.answers.yahoo.com/">Yahoo! Respostas</a>!