title: Java read in a text file and then separate into separate arrays
body: <p>I have a text file which is read in. It has delimeters which are <code>&lt;.&gt;</code> . There is a main subject then there are three paragraphs. Lets say <code>title</code>, <code>section1</code>, <code>section2</code>, <code>section3</code>, and then the next article. </p>
  
  <p>How can I store the data so that ArrayList one will have all the titles, ArrayList 2 will have all the section1 information, etc.? I want be able to output these arrays.</p>
  
  <p>E.g.:<br>
  Large storm on its way.</p>
  
  <p>about the large storm</p>
  
  <p>statics on storms</p>
  
  <p>conclusions about storms</p>
  
  <p>The example above shows what one record would look like.</p>
  
  <pre><code>public void read()
  {
      try
      {
          FileReader fr = new FileReader(file_path);
          BufferedReader br = new BufferedReader(fr);
          String s = "";
          // keep going untill there is no input left and then exit         
          while((s = br.readLine()) != null)
          { }
          fr.close();
      }
      catch (Exception e)
      {
          System.err.println("Error: read() " + e.getMessage());
      }
  }
  
  public static void main(String [] args)
  {
      Reader reader = new ResultsReader("C:/data.txt");
      reader.read();
      String output = ((ResultsReader)reader).getInput();
      String str = "title&lt;.&gt;section1&lt;.&gt;section2&lt;.&gt;";
      String data[] = str.split("&lt;.&gt;");   
  }
  </code></pre>
  
  <p>I am not sure how to store the data in separate ArrayLists so that they can be traversed. </p>