It is necessary to read data from a text file into a two-dimensional array. Data is stored in a .txt file in this form:
1 2 4
2 3.4 5
22 0 0
How to do it?
Scanner scanner = null; try { scanner = new Scanner(new File("matrix.txt")); } catch (FileNotFoundException e) { e.printStackTrace(); } String line = scanner.nextLine(); String[] string = line.split(" ");
Everything, has adjusted this business. It's just late and the brain does not work already)
The question is only one - how to read as long as there is something to read?