title: JAVA: Resetting delimiter after string to use .nextDouble
body: <p>NOTE: Do not want the answer to this problem, as I want to teach myself, but I am stuck and would like advice as to what to do.</p>
  
  <p>So for practice, I have to read an input file and echo it.</p>
  
  <p>The practice problem is to create a ATM transaction, one line of the input file reads:
      Stacy Jones, 300 D 100</p>
  
  <p>I have to output it as:</p>
  
  <pre><code>name
  current balance
  action (D means deposit)
  transaction amount
  </code></pre>
  
  <p>I currently have the name, and to get the current balance I changed the delimiter to end the line at the comma, however my problem is that there is still white space before current balance (i.e. 300)</p>
  
  <p>Here is my code:</p>
  
  <pre><code>try {
      FileInputStream stream = new FileInputStream("src/transactions.txt");
      fileIn = new Scanner(stream);
  
      fileIn.useDelimiter(",");
      name = fileIn.next();
      System.out.println("Customer Name: " + name);
      fileIn.reset();
      balance = fileIn.nextDouble();
      System.out.printf("Checking balance before transaction: %.2f", balance);
  
  } catch (FileNotFoundException e) {
      System.out.println("Transactions cannot be found");
  }
  </code></pre>
  
  <p>The error I am receiving is: </p>
  
  <pre><code>Exception in thread "main" java.util.InputMismatchException
  at java.util.Scanner.throwFor(Scanner.java:857)
  at java.util.Scanner.next(Scanner.java:1478)
  at java.util.Scanner.nextDouble(Scanner.java:2404)
  at MP3.main(MP3.java:30)
  </code></pre>