title: Read mixed types of data from a file with Java
body: <p>I am a bit stuck with this code. I have file <code>file name.txt</code> which contains following data:</p>
  
  <pre><code>BD1               // user ID
  Bob Dillon        // user full name
  user@email.com    // user Email
  10.0              // amount of cash
  100               // No.of Points
  </code></pre>
  
  <p>I can't read first and last name of user in the same string. Here is my code:</p>
  
  <pre><code>Scanner input_File = new Scanner(new File("customer.txt"));
  
  int num_Customers = 0;
  while(input_File.hasNext() &amp;&amp; num_Customers &lt; maxLoyalty_CardsQty)
  {
      //read ID
      customerID[num_Customers] = input_File.next();
      input_File.nextLine();
      //Here is my problems begins
      while(input_File.hasNextLine())
      {
          String line = input_File.nextLine();
          Scanner line_Scan = new Scanner(line);
          line_Scan.useDelimiter(" ");
          fName[num_Customers] = input_File.next();
          lName[num_Customers] = input_File.next();
          line_Scan.close();
      }
      //read Email
      email[num_Customers] = input_File.next();
      //read Cash
      spendToDate[num_Customers] = input_File.nextDouble();
      //read Points
      points[num_Customers] = input_File.nextInt();
      num_Customers++;
  }
  input_File.close();
  </code></pre>