Reading a wordpad file with 3 columns in Java
<p>I want to read a text file containing space sepearted values. Values are integers. How can I read it? I want to read each line and after go to next.</p>

<p>The contents are as the example:</p>

<p>"12/11/2012"        "00.00.01"          0,100</p>

<p>"12/11/2012"            "00.00.05"          0,140</p>

<p>"12/11/2012"            "00.00.09"          0,240</p>

<p>"12/11/2012"            "00.00.13"          0,247</p>

<p>The first column is the date, the second is second and the third is litres.
How can I do it with a Java program?</p>

<p>I think of using Scanner class. I made this program:
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.Scanner;</p>

<pre><code>   public class ScannerExample {

        public static void main(String args[]) throws FileNotFoundException {

            File text = new File("C:\Users\Desktop\test\test.txt");


    Scanner scnr = new Scanner(text);

    int lineNumber = 1;
    while(scnr.hasNextLine()){
        String line = scnr.nextLine();
        System.out.println("line " + lineNumber + " :" + line);
        lineNumber++;
    }       

   }   

}
</code></pre>

<p>But I haven't the result that I would like to have.
Any help?</p>
