title: sqlplus remove \r \n \t from spool
body: <p>Is there any sql*plus command to remove <code>\r</code> <code>\n</code> and<code>\t</code> from the result set that's going out to the spool file? That is, "trim" every record?</p>
  
  <p>We've used  <code>set trim on</code> in the past, but it doesn't seem to bue what we need right now. I'm trying to avoid calling oracle's translate, chr functions in the sql query.</p>
  
  <p>For example,</p>
  
  <pre><code>set termout off
  set spool somefile.dat
  set lin  600
  
  select data from mytable;
  
  set spool off;
  exit;
  </code></pre>
  
  <p>My query returns this</p>
  
  <pre><code>|DATA|
  |\n \t\t\t\t\t thisistheactualdata \t\t\t\t\t\t\n|
  </code></pre>
  
  <p>And I'd like to keep this in my spooled file</p>
  
  <pre><code>thisistheactualdata
  </code></pre>
  
  <h1>update</h1>
  
  <p>Well, we ended up doing something like this.</p>
  
  <pre><code>set tab off;
  spool /home/oracle/out.dat
  
  set linesize 20
  set termout off
  set trim on
  select regexp_replace(l,'(\t|\n)','') from test;
  
  spool off;
  exit;
  </code></pre>
  
  <p>But got some bad news: We need to run this in oracle 8, and regexp_replace doesn't seem to be available. :(</p>
  
  <p>Thanks in advance.</p>