Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk - csv 2

Status
Not open for further replies.

goldtop

Technical User
Dec 29, 2004
1
US
Hi I have space delimited file I would like to turn into a CSV. Basically, I want to replace the spaces with commas. Can awk do this for me?
 
Try:

awk ' {
gsub(/[\t ]/,",",$0)
print
}'
 
tr ' ' ',' < myTextFile.txt vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top