title: How to split a line of a txt file into different variables?
body: <p>I have a txt that is something like this:</p>
  
  <p>Jhon 113<br>
  Paul 024<br>
  David 094<br>
  Peter 085     </p>
  
  <p>and from each line i want to have 2 variables one of the type string for the name and one int for the number   </p>
  
  <p>I wrote this code and what it does its take what ever a line says and ands it to an array called names but i will like to khow how to split the line into two different variables.    </p>
  
  <pre><code>import java.io.*;
  public class Read {
      public static void main(String[] args) throws Exception{
  
          FileReader file = new FileReader("test.txt");
          BufferedReader reader = new BufferedReader(file);
          String names[] = new String[10];
          for(int i = 0; i&lt;names.length;  i++){
              String line = reader.readLine();
              if(line != null){
                  names[i] = line;
              }
          }               
      }
  }
  </code></pre>