I am getting a csv report out of a query and the report is delimited with '|' symbol. I would like to convert this csv report into an xls column wise.. Let me show u an example as below
Say a.csv looks like below
Number|Description|Cycle|Date
3456|This is for the release uvhfiuvhorojpjp|Production|13-03-08
12354|iufviurhrhogtjobvjrjpjk|UAT|26-02-08
I would like to convert the same into excel column wise automatically (see the attachment for details).. I pretty well know that if we open the file in csv it will opt us with delimiter options, but i want that to be automatic in the script itself.. Is there any option in unix to achieve that?
Thanks for your time.. But the above command doesn't seem to be working
sed -ne 's/|/,/g' test > test.csv
I executed the command as in the above line, wherein test contains the data as in my initial mail. You can see test.csv with 0 bytes.. I am afraid that it didnit write anything to it..
/home/ganagdhar$ ls -ltr test*
-rw-rw-r-- 1 gangadhar root 746 28 Sep 06:49 test.sh
-rw-r----- 1 gangadhar root 86 17 Jan 08:02 test
-rw-rw-r-- 1 gangadhar root 0 18 Jan 01:46 test.csv