1
I have a txr file with several columns but I want to get only a specific value of the first one. So far I was able to open the file and separate the values from the header.
<?php
error_reporting(0);
// $delimitador = "/[\t]/";
// Abre o Arquvio no Modo r (para leitura)
$arquivo = fopen ('bases-para-teste/10.txt', 'r');
if($arquivo){
// Lê o conteúdo do arquivo
$cabecalho = fgets($arquivo, 1024);
echo $cabecalho.'<br />';
while(!feof($arquivo))
{
//Mostra uma linha do arquivo
$linha = fgets($arquivo, 1024);
echo $linha.'<br />';
}
// Fecha arquivo aberto
fclose($arquivo);
}
I would like to take only the name column. The file is as follows:
Nome Sobrenome Cidade
Wesley Ferreira Costa São Paulo
Wendel Ferreira Costa São Paulo
How is the format of . txt?
– Guilherme Nascimento
You mean how the contents are inside him ?
– user71502
yes, it doesn’t need to be the real file, just an example already this good
– Guilherme Nascimento
I’ve already updated the post
– user71502