'Oracle: SQLPlus headers appear with '||'|'||'. Headers gets cut halfway

I am writing the below sql code and using sqlplus.

SET HEADING ON
set linesize 2000 pagesize 10000
set feedback off verify off trimspool on trimout on

SELECT 
ID||'|'||
Department||'|'||
Role||'|'||
FROM my_table;

I would like to print the all the rows in my_table to a txt filr. I am also trying to print the headers. Below is the output,

ID||'|'||Department||'|'||Role
--------------------------------------------------------------------------------------------------
111|IT|Consultant
222|HR|Adminstrator

What I would like the output be is:

ID|Department|Role
111|IT|Consultant
222|HR|Adminstrator
  1. I would like the separator between the heading be | instead of ||'|'||
  2. I do not want the line (----) below the heading
  3. Also is there anyway to not list out all the column names and use select * instead and still getting all the formatting. I might have a dynamic table - hence do not want to change the code each time and want to do a select *


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source