views:

205

answers:

0

I have a tab delimited file (MySQL Out file).

I want to convert it into CSV file. I got everything working except for replacing NULLs to nothing or spaces.

What I have is : sed -e 's/^/"/; s/$/"/; s/\t/","/g;' < file.csv > file1.csv

How to also replace NULLs in the same line.

The following doesn't work.

sed -e 's/NULL//; s/^/"/; s/$/"/; s/\t/","/g;' < file.csv > file1.csv

Any input is much appreciated.

Thank you!