title: write data from hashmap as a CSV file
body: <p>Say I have a hashmap with <code>String</code> type as key and <code>ArrayList</code> type as value, example <code>{"value1"=["one","three","five"], "value2"=["two","four","six"]}</code> where "value1" and "value2" are keys. I want to write the above hashmap data in following format. (so that I can read the csv file in excel)</p>
  
  <pre><code>value1,value2
  one,two
  three,four
  five,six
  </code></pre>
  
  <p>My idea was to write the first key and its values as follows</p>
  
  <pre><code>value1
  one
  three
  five
  </code></pre>
  
  <p>Then I was thinking of using the seek method in <code>RandomAccessFile</code> class to back to line 1 and again write the second key and its values. However I am not able to accomplish this task since seek function takes in the length of strings in the entire file and writes the new string after it. While I wanted the pointer to jump to the first line and append the string. Is there a better way to do this?. A quick example would be much appreciated. </p>
  
  <p>Thanks</p>