I have a query that is happening something strange in my code, I put the code and I continue to explain
public void leerPuntuaciones(){
try {
String puntuacion1 = "";
BufferedReader bf = new BufferedReader (new FileReader("nivel 1.csv"));
String linea = bf.readLine();
while((linea=bf.readLine())!=null){
//System.out.println(linea);
String partes[] = linea.split(",");
puntuacion1 = partes[0] +" "+ partes[1];
}
puntuaciones1.add(puntuacion1);
} catch (IOException e) {
e.printStackTrace();
}
Now, in that file that I am reading, I only recognize the last line and what I want to do in that puntuación1
is to add each one of the lines,
Do I have to add the bf.readline
in a for
or something like that?