Hi Guys..
Need your help to format the output of my shell script.
I am using spool command to take out put in csv file.
below is my code. (for example)
col USERNAME for a15
col EMAIL for a30
col FULL_NAME for a20
col LAST_LOGIN for a40
col DATE_CREATED for a40
SPOOL 120.csv
select USERNAME||','||EMAIL||','||FULL_NAME||','||LAST_LOGIN||','||DATE_CREATED from abctable where (trunc(sysdate) -trunc(Last_login))>120 and status = 'Active'
and username not in (select username from scm_authorized_keys)
and ID not in (SELECT distinct created_by_id FROM audit_entry WHERE (TRUNC(SYSDATE) -TRUNC(date_created)) < 120);
SPOOL OFF
but output is not looking as i am expecting.. Moreover.. it is giving title of the column for every single entry. Please find attached sheet.
I need help to remove.
- Highlighted redundancy of column Title
- pipe symbol which is appearing to and forth of column title.
- want to do exact formatting in seperate columns. ( getting date created details down to user name).
Thanks in advance!
p.s. Used alphabetic to show the user names.
Cheers
ash