Thread: Re: cat infile | translate all occurences of "NOT NULL" to ""

Re: cat infile | translate all occurences of "NOT NULL" to ""

From
"Jochen Weyermanns"
Date:

Hi Dan

>  what command do I use to substitute all occurences of a certain string (say,
>  "NOT NULL") with another arbitrary string, (e.g. "")?  I've tried grep and
>  tr, but can't figure it out.

if substitution in 'vi' is not possible due to the size of the file try the
stream editor 'sed'
e.g.:
     sed /"NOT NULL"/s/"NOT NULL"/""/ filename > filename2
(I am not sure, if   ... filename > filename is appropriate)

Jochen