title: How to query without any line breaks within fields and records in oracle?
body: <p>I have 3 fields, <code>"FieldA", "FieldB", and "FieldC"</code> that contain line breaks within the field themselves that when output into a csv that contains values like:</p>
  
  <pre><code>"This is some
  sample text that is listed here"
  </code></pre>
  
  <p>What query or means can I use to query on those fields to get the value while removing any of these line breaks?</p>
  
  <pre><code>set echo off
  set verify off
  set termout on
  set heading off
  set feedback off
  set newpage none
  set recsep off
  
  spool "data.txt"
  SELECT
  LTRIM(RTRIM(REPLACE(REPLACE(c, CHR(10), ''),CHR(13),''))) 
  FROM
  mytable;
  spool off;
  </code></pre>
  
  <p>The current output is:</p>
  
  <pre><code> valueC1
  
  
  
  
   valueC2
  
  
  
  
  
  valueC3
  </code></pre>
  
  <p>All the gaps apparently are all "spaces". How do I get rid of these? I am guessing they are trailing spaces? Trying:</p>
  
  <pre><code>RTRIM(replace(C,Chr(10),''))
  </code></pre>
  
  <p>Appears to have the same output. There must be some kind of strange ghost character i cant see? When I select a column that did not have any weird spaces, then there are no extra spaces in the file generated.</p>