Convert sql output to csv file via bash tools

hi

Can anybody help me with converting such structure into csv file for windows :

BAT_ID       ID_num   CVS_LINE                A_SEG     SKILL_TO         A_CUSTOMER_TYPE
--------- ---------- --------------------------------- ---------- ------------------ ----------- 
14-MAY-11   777752   trw@aol.us                         3        write               35235

I need to convert it in solaris (bash tools tr or awk or sed ) and it will be opened in windows

thanks

thnaks

tr ' ' ';' <input
[ctsgnb@shell ~/sand]$ cat tst2
BAT_ID ID_num CVS_LINE A_SEG SKILL_TO A_CUSTOMER_TYPE
--------- ---------- --------------------------------- ---------- ------------------ -----------
14-MAY-11 777752 trw@aol.us 3 write 35235
[ctsgnb@shell ~/sand]$ tr ' ' ';' <tst2
BAT_ID;ID_num;CVS_LINE;A_SEG;SKILL_TO;A_CUSTOMER_TYPE
---------;----------;---------------------------------;----------;------------------;-----------
14-MAY-11;777752;trw@aol.us;3;write;35235
[ctsgnb@shell ~/sand]$

and how to convert to windows format ?

What do you mean by windows format?
If you are talking of CRLF, since you didnt mention the OS you use you would have to see if you have a ux2dos or unix2dos utility installed...

yes exactly I mean CRLF, bu the problem is that I cant install above mentioned utilities

---------- Post updated at 08:52 AM ---------- Previous update was at 08:50 AM ----------

its o but when I have there structure like
kkkk
it converts to
,,,, kkkk

and that is not required