Spool query to file without output on screen
You can use SQL&gt; SET TERMOUT OFF command to get the result. 

Here are some useful links collected from comments:


Oracle SqlPlus - saving output in a file but don't show on screen
sqlplus, how to stop output to console
How to make sqlplus output appear in one line?
Remove blank lines from csv using shell script for oracle