title: Written CSV file writes only one cell per row
body: <p>I've written a Java class to generate CSV file :</p>
  
  <pre><code>public class CSVGenerator {
  
      private static String REFERRAL_HEADER = "Position,Mail,Invitations,Qualified invitations";
      private static String TOPS_HEADER = "Position,Mail,Number of conferences,Number of new contacts, Average conf duration";
  
      public static String generate(String source, JsonNode root) throws IOException {
          String result = "";
          CSVWriter writer = new CSVWriter(new FileWriter(source+".csv"));
          if (source.compareTo("referral") == 0)
              result = REFERRAL_HEADER;
          else if (source.compareTo("tops") == 0)
              result = TOPS_HEADER;
          writer.writeNext(result.split(","));
          Iterator&lt;JsonNode&gt; it = root.getElements();
          while (it.hasNext()) {
              Iterator&lt;JsonNode&gt; it2 = it.next().getElements();
              result = "";
              while (it2.hasNext())
              {
                  result += it2.next().asText();
                  if (it2.hasNext())
                      result += ",";
              }
              writer.writeNext(result.split(","));
          }
          writer.close();
          return result;
      }
  }
  </code></pre>
  
  <p>The resulting file isn't well formated.
  There's only one cell by row, containing all the cell and the separating comma like this :</p>
  
  <pre><code>header1,header2,header3
  1,support,test
  2,alpha,gamma
  </code></pre>
  
  <p>What am I doing wrong ?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>To be more precise on the output</p>
  
  <p>I have :
  "header1,header2,header3","",""</p>
  
  <p>I want :
  "header1","header2","header3"</p>
  
  <p>Here's my output. Each row in one unique cell.</p>
  
  <pre><code>   ""Position","Mail","Invitations","Qualified invitations""
      ""1","xxxxx.com","129","23""
      ""2","xxxx.com","54","8""
      ""3","xxxx.com","197","5""
      ""4","xxxx","13","5""
      ""5","xxxx","8","4""
      ""6","xxxx.com","4","4""
      ""7","xxx.com","31","3""
      ""8","xxx.com","30","3""
      ""9","xxx.com","18","3""
      ""10","xxx.com","13","3""
  </code></pre>