I have a problem when going through a file .txt
I can read it perfectly but there is a part of that file that I want to skip and start reading from another point so the file starts
Relatório por Data 31/08/16 MEZCLA III 13:36:57 13:43:22 0 6,24T
so just as the file is pasted I want to omit the relational part by data and start reading from the date this is my method in java
public void init() {
File archivo = null;
FileReader fr = null;
BufferedReader br = null;
Date myDate = new Date();
String resultado = new SimpleDateFormat("ddMMyyy").format(myDate);
try {
// Apertura del fichero y creacion de BufferedReader para poder
// hacer una lectura comoda (disponer del metodo readLine()).
archivo = new File("C:\texto\" + resultado + ".txt");
fr = new FileReader(archivo);
br = new BufferedReader(fr);
// Lectura del fichero
String linea;
while ((linea = br.readLine()) != null) {
columns = linea.split(" ");
String fechaC = String.valueOf(columns[0]);
System.out.println(fechaC);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
// En el finally cerramos el fichero, para asegurarnos
// que se cierra tanto si todo va bien como si salta
// una excepcion.
try {
if (null != fr) {
fr.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
At the moment of doing split
just I take the index 0 if I put 1 throw me an exception of Arrayindex