How to write a program in java reading doubles from a txt file and store them on 2 dimension arrays?
<p>**I should make a program that reads double numbers with this format(8,77) from a text file and then store them to arrays. The output of the program should look like this:<br>
3,55 232,22 32,50<br>
3,00 3,01 3,88<br>
2344,87 43,93 43,00    </p>

<p>453,24 24,24 242,43<br>
24,42 34,43 4,40<br>
43,43 43,22 43,22  </p>

<p>5,45 545 5,44<br>
4,55 45,45 45,55<br>
45,45 2,43 43,43<br>
I had done this so far but it doesnt looks like this, and its on integer.. can anybody fix it or help me?**</p>

<pre><code>import java.io.File;
import java.util.*;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class ReadFile {
    public static void main(String[] args) {
        Scanner file = null;
        ArrayList&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
        int[][] board = new int[3][3];
        int counter;
        counter = 0;
        try {
            file = new Scanner(new File("file.txt"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        if (file.hasNext()) {

            for (int a = 0; a &lt; board.length; a++) {
                for (int k = 0; k &lt; board[a].length; k++) {
                    if (file.hasNextInt()) {

                        list.add(file.nextInt());
                    } else {
                        file.next();
                        System.out.println();
                    }
                }
                System.out.println();
            }
            System.out.println();
        }

        for (Integer i : list)
            System.out.println(i);
    }
}
</code></pre>
