Matrix from File
<p>I am trying to create a matrix from a text file. The problem is that when the Buffered Reader function readline() is done parsing first line of file it comes to second line but the its reading it as empty which it is not.</p>

<pre><code>void covar()
    {
        double [][]covar=new double[10][5];
        int i=0;
        int j=0;
        try
        {
            FileInputStream fstream = new FileInputStream("class 1\\feature_vector.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String input;

            while((input=br.readLine())!= null)
            {               
                String [] temp=input.split(",");
                //System.out.println(input.split(",").length);
                covar[i][j]= new Double(temp[0]);
                covar[i+1][j]=new Double(temp[1]);
                covar[i+2][j]=new Double(temp[2]);
                covar[i+3][j]=new Double(temp[3]);
                covar[i+4][j]=new Double(temp[4]);
                //i=0;
                j++;
            }

            in.close();
        }
        catch(Exception e)

        {
            e.printStackTrace();

        }
</code></pre>

<p>Above is the code. The file name is perfect and nothing is wrong with the stream thing. Can you guys help me out with what is wrong with this. </p>

<p>Here is the content of the file:</p>

<pre><code>0.75,321.0,0.22429906,0.97507787,1.966202512778112
0.33333334,135.0,-0.014814815,1.0,5.323770568766052
0.64285713,311.0,0.025723472,1.0,4.764298570227433
0.6,188.0,0.03723404,1.0,4.7349608150168105
0.25,189.0,0.16931216,0.98941797,7.15681209803803
0.71428573,194.0,-0.26804122,0.96391755,5.1654456838422425
0.6,173.0,0.028901733,1.0,6.54275787030257
0.2857143,257.0,0.031128405,1.0,6.095356508899233
0.23076923,197.0,-0.04568528,1.0,3.784908227189768
0.18181819,231.0,0.17316018,0.987013,5.956322938602553
</code></pre>
