nao sei se o que tem entre os numeros e o nome sao espacos ou tabs mas imaginando que sejan tabs<br>($array[$i], $nome) = split(&quot;\t&quot;, $linha);<br><br>assim $array[$i] tera os numeros e $nome os nomes<br>era isso ?<br>
<br>abs<br><div><span class="gmail_quote">Em 20/02/08, <b class="gmail_sendername">gabriel lima</b> &lt;<a href="mailto:gabriellima333@hotmail.com">gabriellima333@hotmail.com</a>&gt; escreveu:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<span style="font-family: Courier New,Courier,Monospace;">Pessoal, estou com um problema que pode ser fácil de resolver para vocês.</span><br style="font-family: Courier New,Courier,Monospace;"><span style="font-family: Courier New,Courier,Monospace;">Mas eu estou tendo um pouco de dificuldade para resolver o mesmo. Se alguem</span><br style="font-family: Courier New,Courier,Monospace;">
<span style="font-family: Courier New,Courier,Monospace;">me ajudar eu ficarei grato!</span><br style="font-family: Courier New,Courier,Monospace;"><br style="font-family: Courier New,Courier,Monospace;"><span style="font-family: Courier New,Courier,Monospace;">Veja, tenho um arquivo .txt com o seguinte formato</span><br style="font-family: Courier New,Courier,Monospace;">
<br style="font-family: Courier New,Courier,Monospace;"><span style="font-family: Courier New,Courier,Monospace;">63528&nbsp;&nbsp; Gabriel Lima</span><br style="font-family: Courier New,Courier,Monospace;"><span style="font-family: Courier New,Courier,Monospace;">537728&nbsp; Outro Nome</span><br style="font-family: Courier New,Courier,Monospace;">
<span style="font-family: Courier New,Courier,Monospace;">645374&nbsp; Fulano De Tal</span><br style="font-family: Courier New,Courier,Monospace;"><span style="font-family: Courier New,Courier,Monospace;">637485&nbsp; Beltrano Alvarenga</span><br style="font-family: Courier New,Courier,Monospace;">
<br style="font-family: Courier New,Courier,Monospace;"><span style="font-family: Courier New,Courier,Monospace;">Eu gostaria de ler este arquivo e armazenar, apenas os número, em um $array[$i].<br>Observe que o primeiro número tem um digito a menos que os demais. Este número<br>
tem que ser armazena sem nenhuma espaço em branco, aliás, nenhum pode.<br><br>Para isso eu já tentei de tudo, expressões regulares, usar um while e ficar<br>dando chop até chegar nos números, mas nenhuma das minhas tentavivas deu certo.<br>
Aliás, minhas tacadas de Golf! (como dizem algumas pessoas aqui da lista) passaram<br>bem longe do &quot;buraco&quot;.<br><br>#!/usr/bin/perl<br><br>use strict;<br><br>my ($i, @array_emp, $linha);<br><br>&nbsp; # Abrindo arquivo para leitura<br>
open(EMP_LISTA, &quot;&lt; teste.txt&quot;) or die &quot;Erro ao abrir arquivo: $!&quot;;<br><br>&nbsp;&nbsp;&nbsp; while($linha &lt;EMP_LISTA&gt;){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  $i = 1;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  $array_emp[$i] = $linha;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  $i++;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  for($i = 0; $i &lt; 4; $i++){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  print &quot;$array_emp[$i]\n&quot;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  }<br>&nbsp; # Fechando arquivo<br>close(EMP_LISTA);<br><br><br>Era mais ou menos algo como isso que eu estava tentando, mas<br>nem me lembro, escrevi rapido para vocês verem o caminho que <br>
eu estava tomando. Acho que está errado.<br><br>Até mais =/<br><br><br><br><br><br><br></span><br><hr>Conheça já o Windows Live Spaces, o site de relacionamentos do Messenger! <a href="http://www.amigosdomessenger.com.br" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Crie já o seu!</a></div>

<br>_______________________________________________<br>
Rio-pm mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Rio-pm@pm.org">Rio-pm@pm.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.pm.org/mailman/listinfo/rio-pm" target="_blank">http://mail.pm.org/mailman/listinfo/rio-pm</a><br></blockquote></div><br>