the colsep operator in sql*plus seperates columns in the output. if the datatype is char(50) and only has a single 'a' in it, the spooled output has all 50 characters for the column.
The best way is to concatenate the columns (note, remove the alias for the date column):
SELECT ip.first_name || ',' || ip.last_name|| ',' || ipd.loginuid|| ',' || ipd.exuid
...
|| ',' || to_char(atk.token_shutdown_date,'MM-DD-YYYY')
This words as long as the full text doesn't exceed 4000 characters. If this is possible, you might have to go to a stored procedure/function and use a CLOB.
>>I also want to remove the query statement in start of CSV file.
Based on your set commands you shouldn't be seeing the SELECT is you execute the script and don't copy and paste it into SQL*Plus.
I ran the following code using your SET values and didn't get the SELECT statement.
SQL> @myscript.sql