title: Java Array parsing
body: <p>I have read a file into an array but am wondering how to parse certain values from that array. </p>
  
  <p>My code:</p>
  
  <pre><code>        ...
          try{
               ...
               String strLine;
               String delims= "[ ]+";
               //parsing it
               ArrayList parsedit = new ArrayList();
               while((strLine=br.readLine())!=null){
                   System.out.println("Being read:");
                   System.out.println(strLine);
                   parsedit.add(strLine.split(delims));
               }
               System.out.println("Length:" + parsedit.size());
               in.close();   
               ...
  </code></pre>
  
  <p>The files that I am reading in are like this:</p>
  
  <pre><code>a b c d e f g
  1 2 3 4 5 6 7
  1 4 5 6 3 5 7
  1 4 6 7 3 2 5
  </code></pre>
  
  <p>Which makes the output like this:</p>
  
  <pre><code>How many files will be input? 1
  Hey, please write the full path of the input file number1! 
  /home/User/Da/HA/file.doc
  Being read:
  a b c d e f g 
  Being read:
  1 2 3 4 5 6 7 
  ...
  Length:4
  </code></pre>
  
  <p>I would like to parse out this data and just have the first and fifth values remaining, so that it would read like this instead:</p>
  
  <pre><code>a e
  1 5
  </code></pre>
  
  <p>Does anyone have a recommendation on how to go about it? 
  EDIT:
  Following some of the suggestions I have changed my code to:  </p>
  
  <pre><code>public static void main(String[] args) {
          System.out.print("How many files will be input? ");
          Scanner readIn=new Scanner(System.in);
          int input=readIn.nextInt();
          int i=1;
          while(i&lt;=input){
              System.out.println("Hey, please write the full path of the input file number" + i + "! ");
              Scanner fIn=new Scanner(System.in);
              String fileinput=fIn.nextLine();
            try{
               FileInputStream fstream=new FileInputStream(fileinput);
               DataInputStream in=new DataInputStream(fstream);
               BufferedReader br=new BufferedReader(new InputStreamReader(in));
               String strLine;
               String delims= "[ ]+";
               ArrayList parsedit = new ArrayList();
               while((strLine=br.readLine())!=null){
                   System.out.println("Being read:");
                   System.out.println(strLine);
                   parsedit.add(strLine.split(delims));
               }
               String[] splits=strLine.split(delims);
               System.out.println("Length:" + splits.length);
               in.close();   
          }
          catch(Exception e){
              System.err.println("Error: " + e.getMessage());
          }
          i++;
      }
    }
  }
  </code></pre>
  
  <p>This doesn't give back any errors but it doesn't seem to be working all the same. Am I missing something silly? The output is this:</p>
  
  <pre><code>How many files will be input? 1
  Hey, please write the full path of the input file number1! 
  /home/User/Da/HA/file.doc
  Being read:
  a b c d e f g 
  Being read:
  1 2 3 4 5 6 7 
  ...
  </code></pre>
  
  <p>But despite the fact that I have a line to tell me the array length, it never gets printed, which tells me I just ended up breaking more than I fixed. Do you know what it is that I may be missing/forgetting?</p>