title: Fastest way to parse txt file in Java
body: <p>I have to parse a txt file for a tax calculator that has this form:</p>
  
  <pre><code>Name: Mary Jane
  Age: 23
  Status: Married
  Receipts:
  
  Id: 1
  Place: Restaurant
  Money Spent: 20
  
  Id: 2
  Place: Mall
  Money Spent: 30
  </code></pre>
  
  <p>So, what i have done so far is: </p>
  
  <pre><code>public void read(File file) throws FileNotFoundException{
      Scanner scanner = new Scanner(file);
      String[] tokens = null;
  
      while(scanner.hasNext()){
          String line= scanner.nextLine();
          tokens = line.split(":");
          String lastToken = tokens[tokens.length - 1];
          System.out.println(lastToken);
  </code></pre>
  
  <p>So, I want to access only the second column of this file (Mary Jane, 23, Married) to a class taxpayer(name, age, status) and the receipts' info to an Arraylist.</p>
  
  <p>I thought of taking the last token and save it to an String array, but I can't do that because I can't save string to string array. Can someone help me? Thank you.</p>