hi
i have input file in this format
E102|0|1-23-1994|0|12-5-1994|E003|A|10450|charan,devupalli|5000
how to convert this into outfile
E102,0,1-23-1994,0,12-5-1994,E003,A,10450,charan,devupalli,5000
i wann the output in excel sheet.........that is why i am converting into csv..
but i have the name file as firstname, lastname and it should be present in one column charan,devupalli
I CAN CONVERT THE FILE BY USING SED......AND I AM GETTING THE OUT PUT.........
BUT I AM GETTING THE CHARAN IN ONE SEPARATE COLUMN AND THE DEVUPALLI IN SEPARATE COLUMN.
I NEED TO GET THE CHARAN,DEVUPALLI IN A SINGLE COULMN........HOW TO DO THAT........
second, I think your problem lies with the way u handle Excel, not in Unix. If you convert all "|" to commas, the comma becomes a delimiter and "charan,devupalli" become two seperate items, delimited by commas.
A csv file does not need to have comma as a delimiter, you can set the pipe sign as a delimiter too (Use the Tools-> Text to columns and you can set the delimiter there)
So you can use the very first line directly in excel, no need to mod it in unix. you're just going circles.
If you actually want to convert the separator to comma for unrelated reasons, you can have comma inside a field by putting it in double quotes. Different (per)versions of Excel have different bugs and conventions for how exactly they break when you try to do this, so you will have to experiment a bit.