I am using a shell script like the following to spool two columns(fields) of a particular table into a csv file as follow:
#!/usr/bin/bash
FILE="emp.csv"
sqlplus -s scott/tiger@XE <<EOF
SET PAGESIZE 50000
SET COLSEP ","
SET LINESIZE 200
SET FEEDBACK OFF
SPOOL $FILE
SELECT name,city FROM EMP;
SPOOL OFF
EXIT
EOF
But the resulting csv file is becoming too large for my editor to open. Is there any way by which I can split the records into multiple csv files which are smaller and can be opened ? Can I use some counter such that when it exceeds a particular value the data is spooled to another file ?
split
command?