The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 06-20-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,302
Don't pipe the result of the cat command to the file. This is sufficient:

Code:
awk 'BEGIN{FS=OFS=","}{for(i=1;i<=NF;i++){if($i=="0"){$i=""}}}1' SLsTester_DataFile.csv
You can redirect the output to a file as follow:

Code:
awk 'BEGIN{FS=OFS=","}{for(i=1;i<=NF;i++){if($i=="0"){$i=""}}}1' SLsTester_DataFile.csv > NewFile
Regards