title: Read excel using apache poi - Hashmap,ArrayList
body: <p><a href="https://i.stack.imgur.com/toabg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/toabg.png" alt="enter image description here"></a></p>
  
  <p>Hi,</p>
  
  <p>I am trying to read column values using column headers in excel (using java). As attached in the image, suppose i want to read for header "city", all subsequent cells under the column and display them . How will i do that ?</p>
  
  <p>Looking at examples over the internet, i found most of the examples iterating using an iterator  over the row. </p>
  
  <p>Suppose i have a hashmap of key as headers of excel and subsequent values stored in ArrayList. Something like </p>
  
  <pre><code>HashMap&lt;String, ArrayList&lt;String&gt;&gt; hashmap = 
                  new HashMap&lt;String, ArrayList&lt;String&gt;&gt;();
  </code></pre>
  
  <p>How should i proceed ? Can anyone help me with the code and logic? </p>
  
  <p>Please do not mark this as duplicate, i have tried searching over stackoverflow and internet, but most of them iterate using the row. </p>