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

From: "Tamsin" <tg_mail(at)bryncadfan(dot)co(dot)uk>
To: "Dan Browning" <danb(at)cyclonecomputers(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: RE: cat infile | translate all occurences of "NOT NULL" to ""
Date: 2000-09-11 14:36:32
Message-ID: NEBBKHBOBMJCHDMGKCNJAECKCDAA.tg_mail@bryncadfan.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

in vi you can type : and then 1,$s/oldstring/newstring/g
where 1 means start from the first line, $ means until the end of the file,
oldstring is what you want to replace, newstring is what you want to replace
it with, and the g means do it globally throughout the file.

e.g. 1,$s/NOT NULL//g should work

Hope this helps
Tamsin

-----Original Message-----
From: pgsql-novice-owner(at)hub(dot)org [mailto:pgsql-novice-owner(at)hub(dot)org]On
Behalf Of Dan Browning
Sent: 11 September 2000 15:16
To: pgsql-novice(at)postgresql(dot)org; redhat-list(at)redhat(dot)com;
jsokel(at)mdsi-usa(dot)com
Subject: [NOVICE] cat infile | translate all occurences of "NOT NULL" to
""

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.

Thanks,

Dan Browning
Network & Database Administrator
Cyclone Computer Systems

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2000-09-11 14:44:16 Re: Multiple Selects
Previous Message Dan Browning 2000-09-11 14:15:59 cat infile | translate all occurences of "NOT NULL" to ""