The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-17-2006
mona's Avatar
mona mona is offline
Registered User
  
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
Quote:
Originally Posted by charan81
Hi,

Can anyone let me know on how to convert a Tab delimited file to Comma delimited file in Unix

Thanks!!
You can use sed to convert the Tab delimited file to a comma delimited file


Code:
/export/home/test/mona>cat tab_del.dat
1       2       3       4       5
6       7       8       9       10
/export/home/test/mona>sed 's/        /,/g' tab_del.dat
1,2,3,4,5
6,7,8,9,10

Redirect the output of this to another file and rename it.