title: Scala - how to pass delimiter as a variable when writing dataframe as csv
body: <p>Using a variable as a delimiter to dataframe.write.csv is not working.  Trying out alternatives is working out to be too complicated.  </p>
  
  <pre><code> val df = Seq(("a", "b", "c"), ("a1", "b1", "c1")).toDF("A", "B", "C")
   val delim_char = "\u001F"
  
   df.coalesce(1).write.option("delimiter", delim_char).csv("file:///var/tmp/test")  // Does not work -- error related to too many chars
   df.coalesce(1).write.option("delimiter", "\u001F").csv("file:///var/tmp/test")  //works fine...
  </code></pre>
  
  <p>I have tried .toHexString, and many other alternatives...  </p>