douglaskd , obrigado pela força, funcionou certinho mesmo a tua solução foi primordial para eu solucionar o problema. Além disso, eu também fiz uma desse jeito:
public class Main
{
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException
{
File arquivo = new File("src/arqteste.txt");
int cont = 0;
try
{
BufferedReader in = new BufferedReader(new FileReader(arquivo));
String texto = null;
while (!(texto = in.readLine()).equalsIgnoreCase("time"))
{
String dados[] = texto.split(" ");
int tempx = Integer.valueOf(dados[0]);
int tempy = Integer.valueOf(dados[1]);
int tempz = Integer.valueOf(dados[2]);
cont++;
System.out.println("X="+ tempx + " Y=" + tempy + " Z=" + tempz)
}
catch (Exception ex)
{
System.out.println("\nErro ao tentar abrir: Verifique o nome do arquivo e o lugar onde ele está");
}
}
}
Porém a tua solução é mais elaborada e bem mais fácil de entender.
Muitissimo obrigado
Agora meu grande problema é o seguinte:
Em alguns arquivos aparece a palavra time mais de uma vez:
Ex
2 0 0 0
2 0 1 0
2 0 2 0
2 0 3 0
2 0 4 0
2 0 5 0
2 0 6 0
2 0 7 0
2 0 8 0
2 0 9 0
2 0 10 0
2 0 11 0
2 0 12 0
2 0 13 0
2 0 14 0
time
2 59 46 0
2 59 47 0
2 59 48 0
2 59 49 0
2 59 50 0
2 59 51 0
2 59 52 0
2 59 53 0
2 59 54 0
2 59 55 0
2 59 56 0
2 59 57 0
2 59 58 0
2 59 59 0
time
Ou seja, quando chegar no time ele armazena os valores no vetor, isso já estou conseguindo fazer, agora como continuar armazenando outros valores depois do time?
logo ficará assim:
X = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Y = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Z = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
X1 = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Y1 = 59 59 59 59 59 59 59 59 59 59 59 59 59 59
Z1 = 46 47 48 49 50 51 52 53 54 55 56 57 58 59
Obrigado mais uma vez pela força.