title: Scanner through a line with whitespace and comma
body: <p>I am new to Java and looking for some help with Java's Scanner class. Below is the problem.
  I have a text file with multiple lines and each line having multiple pairs of digit.Such that each pair of digit is represented as ( digit,digit ). For example 3,3 6,4 7,9.  All these multiple pairs of digits are seperated from each other by a whitespace. Below is an exampel from the text file.</p>
  
  <p>1 2,3 3,2 4,5</p>
  
  <p>2 1,3 4,2 6,13</p>
  
  <p>3 1,2 4,2 5,5</p>
  
  <p>What i want is that i can retrieve each digit seperately. So that i can create an array of linkedlist out it. Below is what i have acheived so far.</p>
  
  <pre><code>Scanner sc = new Scanner(new File("a.txt"));
      Scanner lineSc;
      String line;
      Integer vertix = 0;
      Integer length = 0;
      sc.useDelimiter("\\n"); // For line feeds
  
      while (sc.hasNextLine()) {
          line = sc.nextLine();
          lineSc = new Scanner(line);
  
          lineSc.useDelimiter("\\s"); // For Whitespace
          // What should i do here. How should i scan through considering the whitespace and comma
          }
  </code></pre>
  
  <p>Thanks</p>