title: Escape or remove a new line from a file being parsed WITHOUT quotes
body: <p>I have a csv where a column sometimes contains a new line character (\n or \r), I need to parse this file into a dataframe ignoring or removing those characters BUT these values are NOT surrounded by quotes other wise I could simply add <code>.option(&quot;multiline&quot;,true)</code></p>
  <p>similar question with values surrounded by quotes:
  <a href="https://stackoverflow.com/questions/48800046/escape-new-line-character-in-spark-csv-read">Escape New line character in Spark CSV read</a></p>
  <p>Sample Code:</p>
  <pre class="lang-scala prettyprint-override"><code>val df = spark.read
  .option(&quot;wholeFile&quot;, true)
  .option(&quot;multiline&quot;,true)
  .option(&quot;header&quot;, true)
  .option(&quot;inferSchema&quot;, &quot;true&quot;)
  .option(&quot;dateFormat&quot;, &quot;yyyy-MM-dd&quot;)
  .option(&quot;timestampFormat&quot;, &quot;yyyy-MM-dd HH:mm:ss&quot;)
  .csv(&quot;test.csv&quot;)
  </code></pre>
  <p>sample input:</p>
  <pre><code>id,commment,name
  1,good,bob
  2,bad
  ,tim
  3,fine,sarah
  </code></pre>
  <p>sample output:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>comment</th>
  <th>name</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>good</td>
  <td>bob</td>
  </tr>
  <tr>
  <td>2</td>
  <td>bad</td>
  <td>null</td>
  </tr>
  <tr>
  <td>tim</td>
  <td>null</td>
  <td>null</td>
  </tr>
  <tr>
  <td>3</td>
  <td>fine</td>
  <td>sarah</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>desired output:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>comment</th>
  <th>name</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>good</td>
  <td>bob</td>
  </tr>
  <tr>
  <td>2</td>
  <td>bad</td>
  <td>tim</td>
  </tr>
  <tr>
  <td>3</td>
  <td>fine</td>
  <td>sarah</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p><em>edit</em> table formatting</p>