title: How do you write a dataframe/RDD with custom delimeiter (ctrl-A delimited) file in spark scala?
body: <p>I am working over poc in which I need to create dataframe and then save it as ctrl A delimited file.
  My query to create intermediate result is below</p>
  
  <pre><code>val grouped = results.groupBy("club_data","student_id_add","student_id").agg(sum(results("amount").cast(IntegerType)).as("amount"),count("amount").as("cnt")).filter((length(trim($"student_id")) &gt; 1) &amp;&amp; ($"student_id").isNotNull)
  </code></pre>
  
  <p>Saving result in text file</p>
  
  <pre><code>grouped.select($"club_data", $"student_id_add", $"amount",$"cnt").rdd.saveAsTextFile("/amit/spark/output4/")
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code> [amit,DI^A356035,581,1]
  </code></pre>
  
  <p>It saves data as comma separated but I need to save it as ctrl-A separate 
  I tried option("delimiter", "\u0001") but seems it's not supported by dataframe/rdd.</p>
  
  <p>Is there any function which helps?</p>