I wrote the following script to select data from a database and save it in a CSV file using isql:
OUTPUT temp/filename.csv FORMAT csv DELIMITED BY ';';
SELECT dept_no, department, location FROM department;
I got the following result in the CSV file:
DEPT_NO DEPARTMENT LOCATION
======= ========================= ===============
000 Corporate Headquarters Monterey
100 Sales and Marketing San Francisco
600 Engineering Monterey
900 Finance Monterey
180 Marketing San Francisco
620 Software Products Div. Monterey
621 Software Development Monterey
622 Quality Assurance Monterey
623 Customer Support Monterey
670 Consumer Electronics Div. Burlington, VT
671 Research and Development Burlington, VT
672 Customer Services Burlington, VT
130 Field Office: East Coast Boston
140 Field Office: Canada Toronto
110 Pacific Rim Headquarters Kuaui
115 Field Office: Japan Tokyo
116 Field Office: Singapore Singapore
120 European Headquarters London
121 Field Office: Switzerland Zurich
123 Field Office: France Cannes
DEPT_NO DEPARTMENT LOCATION
======= ========================= ===============
125 Field Office: Italy Milan
However, I need to get an output 1) without the repeating headings and 2) without the space between data in the columns.
An ideal output should look like this:
ID;LASTNAME;FIRSTNAME;DOB
1;Miller;Steve;1980-06-28
2;Jones;Martha;1965-11-02
3;Waters;Richard;1979-10-15
Would anyone help me to fix this problem?