title: SQLPlus Trailing Whitespace Issues
body: <p>My script is spooling the output of some queries to a text file.</p>
  
  <pre><code>set linesize 200
  set trimspool on
  ....
  
  spool "C:\someFile.txt"
  SELECT rpad(field1, 50)||rpad(field2, 50) FROM table1;
  SELECT rpad(field3, 200) FROM table2;
  spool off
  </code></pre>
  
  <p>What I want is for every row output in query 1 to be 100 characters including trailing whitespace, and for every row output in query 2 to be 200 characters including trailing whitespace.  </p>
  
  <p>If <code>trimspool</code> is off, then every line has 200 characters, which is not what I want.  If it is on, then in the case that field3 is only 10 characters long, the length of that line in the output file is only 60 characters (it needs to be 100).  Each line needs to be fixed length because the file will be sent to an external server and is going parsed based on the assumption that it is fixed length.</p>
  
  <p>Is there any way to avoid trimming the whitespace that I explicitly output?</p>