title: How to put sql query output from linux to a file in proper format?
body: <p><a href="https://i.stack.imgur.com/v5s5H.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v5s5H.jpg" alt="enter image description here"></a></p>
  
  <p>I am running a shell scipt which connects to oracle and runs a select query and display data in above format (screenshot attached). I am redirecting this data to a file using spool command. How can I have data in a tabular format in my file like excel with a headers.</p>
  
  <p>I have tried below options but its not working properly</p>
  
  <pre><code>set feedback off
  set pages 0
  set verify off
  set pagesize 0 embedded on
  SET COLSEP ","
  SET LINESIZE 200
  SET UNDERLINE =
  set markup on
  set termout off
  BREAK ON ROW SKIP PAGE
  </code></pre>