title: Remove spaces from all column names in pyspark
body: <p>I am new to pySpark. I have received a csv file which has around 1000 columns. I am using databricks. Most of these columns have spaces in between eg &quot;Total Revenue&quot; ,&quot;Total Age&quot; etc. I need to updates all the column names with space with underscore'_'.</p>
  <p>I have tried this</p>
  <pre><code>foreach(DataColumn c in cloned.Columns)
      c.ColumnName = String.Join(&quot;_&quot;, c.ColumnName.Split());
  </code></pre>
  <p>but it didn't work in Pyspark on databricks.</p>