 <p>Put your FOR loops in two different anonymous blocks, then do a <code>SPOOL OFF</code> followed by <code>SPOOL INV.CSV</code> between them. The first should go to one file and the second to the other.</p>