What I try to do in this program is to pass a file that contains a series of tables as if it were an excel and to fit the data in the code so that the data is printed in the same way in java.lang. NullPointerException that I get at the end of my impression, I do not really know what is due so I would like you to help me please. According to the program my error is on line 25.
try {
String[] data = new String[47];
String lineaTemporal;
File archivo = new File("Mat.txt");
FileReader fr = new FileReader(archivo);
BufferedReader br = new BufferedReader(fr);
String linea;
for (int i = 0; i < 47; i++) {
data[i] = br.readLine();
lineaTemporal = data[i];
String[] parts = lineaTemporal.split(" ");
for (String part1 : parts) {
System.out.print(part1);
System.out.print("\t");
}
System.out.println("");
}
//while ((linea = br.readLine()) != null) {
// System.out.println(linea);
//}
} catch (Exception e) {
e.printStackTrace();
}