I am using sqlplus in shell script to connect to DB and spool .csv file.
code is:-
sqlplus -s user/pass@db <<EOF> /dev/null 2>&1
SET COLSEP ','
SET FEEDBACK OFF
SET TRIMSPOOL ON
SET UNDERLINE OFF
SET LINESIZE 10000
SET PAGESIZE 10000
spool customer.csv
select * from customer where cust_name='john';
spool off
EOF
i get my header trim for few Colum's like 1st, 2nd 4th and 7th.

