title: How to remove unnecessary characters from a SQL*Plus result?
body: <p>I'm looking for a way of removing all unnecessary characters from a SQL*Plus query result.</p>
  
  <p><strong>FYI: my company requires to hide any data before I post questions here, so I've replaced ALL column names with XXXXXXX (the lenght of the words stays the same) and all data with DDDDDDDD. I'm sorry for doing this but I don't want any trouble ;)</strong></p>
  
  <p>FIRSTLY: I want to reduce all the SQL*Plus output to one of two examples.</p>
  
  <p>The first one is the same as a result of a query in PL/SQL Developer, and it looks like this:</p>
  
  <pre><code>DDDD,DDDD,DDDDDD,DDDDDDDDD,,,DDDDDDDDDDDD,DDDDDDD,DDDDDDDDD,D,DDDDDDDDD,DDDDDDDDD, ,DDD,DDD,DDD,D
  DDDD,DDDD,DDDDDD,DDDDDDDDD,,,DDDDDDDDDDDD,DDDDDDD,DDDDDDDDD,D,DDDDDDDDD,DDDDDDDDD, ,DDD,DDD,DDD,D
  DDDD,DDDD,DDDDDD,DDDDDDDDD,,,DDDDDDDDDDDD,DDDDDDD,DDDDDDDDD,D,DDDDDDDDD,DDDDDDDDD, ,DDD,DDD,DDD,D
  </code></pre>
  
  <p>The second possibility (with the column names, as default in SQLPlus:</p>
  
  <pre><code>XXXXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXXXXXXXX,XXXXXXXXXXX,XXXXXXXXX,        XXXX,XXXXXXXXXXXXXXXXXXX,XXXXXXXXX,X,XXXXXXXXX,XXXXXXXXX,  X,XXXXXXXXXXXX,XXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXX
  ------------------,------------------,------------------------,----------------------,-----------,---------,------------,-------------------,---------,-,---------,---------,---,------------,----------------,----------------,----------------
                DDDD,              DDDD,          DDDDDD,         DDDDDDDDD,           ,         ,DDDDDDDDDDDD,        DDDDDDD,DDDDDDDDD,D,DDDDDDDDD,DDDDDDDDD,DDD,         DDD,             DDD,             DDD,               D
  </code></pre>
  
  <p>You have the basics. Now. For the current results I have.</p>
  
  <p>Pure SQLPlus result with only one modification which is</p>
  
  <pre><code>set colsep ','
  </code></pre>
  
  <p>Looks like this:</p>
  
  <pre><code>XXXXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXXXX
  ------------------,------------------                                           
  XXXXXXXXXXXXXXXXXXXXXXXX                                                        
  --------------------------------------------------                              
  XXXXXXXXXXXXXXXXXXXXXX
  --------------------------------------------------------------------------------
  XXXXXXXXXXXXXX                                                                    
  --------------------------------------------------                              
  XXXXXXXXX                                                                       
  --------------------------------------------------------------------------------
  XXXX
  --------------------------------------------------------------------------------
  XXXXXXXXXXXXXXXXXXX                               ,XXXXXXXXX,X,XXXXXXXXX        
  --------------------------------------------------,---------,-,---------        
  XXXXXXXXX,X,XXXXXXXXXXXX                                      ,XXXXXXXXXXXXXXXX 
  ---------,-,--------------------------------------------------,---------------- 
  XXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXX                                               
  ----------------,----------------                                               
                DDDD,              DDDD 
  </code></pre>
  
  <p>As You can see, there are tons of --------- there, and the piece of the result I've shown You is covering JUST the results from first 2 columns (DDDD,DDDD). There is no need to paste all the results, but they look the same. The mix of column names and ---------- is repeating many times, just to cover one or two results. This makes all the result totally unreadable.</p>
  
  <p>I've tried to do the same with this set of commands:</p>
  
  <pre><code>set heading off
  set recsep off
  </code></pre>
  
  <p>The result I got was CLOSE to what I wanted... but still FULL of unnecessary spaces and line breaks (I assume that the line breaks are coming from the</p>
  
  <pre><code>linesize
  </code></pre>
  
  <p>property.</p>
  
  <p>It looks like this:</p>
  
  <pre><code>DDDDDDD, DDDDDDD
  DDDDDDD                                           ,DDDDDDDDD,D,DDDDDDDDD
  DDDDDDDDD, ,DD                                                ,             DDD
           DDD,               D
  </code></pre>
  
  <p>Is there any way of removing all the unneccessary spaces and linebreaks?</p>
  
  <p><strong>What would be the best method to write ONE styling for the SQLPlus output that will produce at least readable results for different set of queries?</strong></p>