Good I have an error when printing the results of a text file I separated them with a split
and I create a String[] columns
and with a String dato1 = String.valueOf(columns[0]);
I assigned the value but when printing this String
no it brings me as a result all the data in that file, only some of them will give you an example of how my text file is composed.
Figure 1:
fecha1 hora de e/s 13:36:57 13:43:22 6,24T
fecha2 hora de e/s 13:43:40 13:53:22 10,77T
fecha3 hora de e/s 13:53:47 14:03:56 11,56T
fecha4 hora de e/s 14:04:40 14:13:47 11,13T
fecha5 hora de e/s 14:14:16 14:22:36 12,33T
At the time of printing, it only prints the value of 10,77
down to 6,24
does not take it but if the file is placed in this way
Figure 2:
6,24T
10,77T
11,56T
11,13T
12,33T
If I print them well but the text file is automatically generated as shown in figura 1
this is the code used.
while ((linea = br.readLine()) != null) {
columns = linea.split(" ");
datos date = new datos();
String dato1 = String.valueOf(columns[0]);
System.out.println(dato1);
}