title: Creating a CSV File in java from a HashMap
body: <p>I have a hashMap in java in terms of some keys which each key is indicating a flow. Then each value showing statics about each packet belongs to that flow.</p>
  
  <p>What I need to do is, to draw graphs for each flow based on those values. for example:</p>
  
  <pre><code>  Flow1: {[length, time],[],[],...}
    Flow2: {[length, time],[length, time],[],...}
  </code></pre>
  
  <p>i need to create a CSV file that then can be read from MS excel. Can anyone has the idea to give me some clues please?</p>
  
  <p>Edited:
  here is my hashMap:</p>
  
  <pre><code>    Iterator&lt;Flows&gt; iterator =  myHashMap.keySet().iterator();
      String fileName = ((args.length &gt; 0) ? args[0] : "jexcel.xls");
      Map&lt;String, ArrayList&gt; csv = new HashMap&lt;String, ArrayList&gt;();
      int i=0;
  
      while(iterator.hasNext()){
          Flows key = iterator.next();
          ArrayList value = myHashMap.get(key);
          csv.put("Flow["+i+"]", value);
  
  
      }
  </code></pre>