A question about sed 
Author Message
 A question about sed

Hi,

I realise that this is a newsgroup for awk. I can't find a newsgroup
for sed. So please pardon me.

I want to do the following:-

Remove following lines from a text file:-
{TABLE "dba".interline row size = 684 number of columns = 16
index size = 45 }

Basically all {*filter*}between braces { and }.

Also I want to change
type char(1) not null constraint "dba".n274_269,
to
type char(1) not null ,

That is remove all words from "constraint" till ",".

TIA.



Sun, 23 May 2004 02:35:45 GMT  
 A question about sed

19:35:

Quote:
> Hi,

> I realise that this is a newsgroup for awk. I can't find a newsgroup
> for sed. So please pardon me.

> I want to do the following:-

> Remove following lines from a text file:-
> {TABLE "dba".interline row size = 684 number of columns = 16
> index size = 45 }

> Basically all {*filter*}between braces { and }.

> Also I want to change
> type char(1) not null constraint "dba".n274_269,
> to
> type char(1) not null ,

> That is remove all words from "constraint" till ",".

> TIA.

comp.unix.shell or comp.unix.questions should be the right ng to ask.
However, it's just as simple as this (foo will be exchanged with bar):

sed -e "s/foo/bar/g" < infile > outfile.tmp; mv outfile.tmp infile

'man sed' for more info.

Michael Heiming



Sun, 23 May 2004 03:02:59 GMT  
 A question about sed
Michael Heiming says...

Quote:
>Was there a problem with my answer on comp.lang.awk?

Yes.It was useless :-)

Quote:
>comp.unix.shell or comp.unix.questions should be the right ng to ask.
>However, it's just as simple as this (foo will be exchanged with bar):

>sed -e "s/foo/bar/g" < infile > outfile.tmp; mv outfile.tmp infile

>'man sed' for more info.

I know this basic stuff. I specifically wanted to know how to
do those two, which is not as simple as changing foo to bar.
That's why I posted.


Sun, 23 May 2004 03:19:04 GMT  
 A question about sed

20:19:

[SNIP of repeated question in comp.unix.questions]

Please read: http://www.cs.tut.fi/~jkorpela/usenet/xpost.html

Michael Heiming



Sun, 23 May 2004 03:42:48 GMT  
 A question about sed

Quote:

> I want to do the following:-
> Remove following lines from a text file:-
> Basically all {*filter*}between braces { and }.
> Also I want to change
> type char(1) not null constraint "dba".n274_269,
> That is remove all words from "constraint" till ",".

if you do not mind using a beginer's solution
here it is

sed "/{ /,/ }/d; /constraint "/,/,/d" myfile

hth



Fri, 28 May 2004 09:50:24 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Stupid question...Is sed in gawk??

2. A very simple question on SED or AWK for a GURU, and an enjoyable problem

3. question on SED

4. [Fwd: question about sed.]

5. A very simple question on SED or AWK for a GURU, possibly a lisp script or emacs batch processing of many files

6. Newbie awk (sed??) question, regular expressions

7. SED question

8. a sed question

9. Awk/Sed Filehandler question

10. How to do this.. (SED question)

11. Sed/awk question Answered!

12. question on substituting a newline in SED

 

 
Powered by phpBB® Forum Software