title: Java Buffered Reader to map
body: <p>I'm trying to reader from a file which is stored as below for a quiz;</p>
  
  <p>With the identifier and question identifier on the first line, then a question heading with the question next, answer heading with answers and finally the selected answer.</p>
  
  <p>I'm trying to read the file and then store it using a HashMap
  </p>
  
  <pre><code>16 TF
  Question
  Because an ArrayList is an indexed collection, you can access its elements using a subscript. 
  Answer
  False
  True
  Selected
  1
  
  258 MC
  Question
  Fill in the blank. A Node is generally defined inside another class, making it a(n) ____ class.
  Answer 
  Private 
  Inner 
  Public 
  Internal 
  Selected 
  2
  
  37 L5
  Question
  How would you rate your programming skills? 
  Answer
  Excellent
  Very good
  Good
  Not as good as they should be
  Poor
  Selected
  -1
  </code></pre>
  
  <p>My code:
  </p>
  
  <pre><code>  Quiz newquiz = new Quiz();
      List&lt;String&gt; newArray = new ArrayList&lt;String&gt;();
      Map&lt;Integer, String&gt; newquizmap = new HashMap&lt;Integer, String&gt;();
      BufferedReader BufferedReader = new BufferedReader(new FileReader('file.txt'));
      String line = null;
  
      while ((line = BR.readLine()) != null) {
          String nuquiz[] = line.split("   ");
          BufferedReader.readLine();
  
         newquiz.newquestionid = Integer.parseInt(parts[0]);
  
  
  
               lines.add(line);
                 newquizmap.put(newquiz.newquestionid, newArray.toString());
  
  
              line = BufferedReader.readLine();
  
              System.out.println(newquizmap);
          } 
  
      } BR.close();
  </code></pre>
  
  <p>I know this isn't right, I don't even think it's close but I'm really struggling with this could anyone give me any help?</p>
  
  <p>EDIT:</p>
  
  <pre><code>          Quiz newquiz = new Quiz();
      List&lt;String&gt; newArray = new ArrayList&lt;String&gt;();
      Map&lt;Integer, String&gt; newquizmap = new HashMap&lt;Integer, String&gt;();
      BufferedReader BufferedReader = new BufferedReader(new FileReader('file.txt'));
      String line = null;
  
      while ((line = BR.readLine()) != null) {
          String nuquiz[] = line.split("   ");
          BufferedReader.readLine();
  
         newquiz.newquestionid = Integer.parseInt(parts[0]);
  
  
  
               lines.add(line);
                 newquizmap.put(newquiz.newquestionid, newArray.toString());
  
  
              line = BufferedReader.readLine();
  
              System.out.println(newquizmap);
          } 
  
      } BR.close();
  </code></pre>
  
  <p>Tried this code and it appears to fill every map key with every value?</p>