title: Java Scanner not grabbing full line
body: <p>I'm using two scanners, 1 for reading in the whole file and the 2nd one for reading in the current line.</p>
  
  <p>The input coming in from the file would be in the format string,int,string.</p>
  
  <p>The issue is that if the 3rd string has a space it will only read in the part of the string up to the white space, and on the next loop the scanner grabs the 2nd part of the 1st string.</p>
  
  <p>So for example if the 3rd string would be "the tree", word only becomes " the", and type will become " tree", which messes up the whole program. So all I need it to do, is make the 3rd string become the rest of the line because I already got the required information.</p>
  
  <pre><code> while(scanner.hasNextLine()) {
              String line = reader.next();
              line = line.replaceAll("," , " ");
              Scanner scan = new Scanner(line);
              String type = scan.next();
              int quant = scan.nextInt();
              String word = scan.nextLine();
              scan.close();
          }
  </code></pre>
  
  <p>Edit: Solved it myself, line should be reader.nextLine() not reader.next(). </p>