Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: Can awk, se...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 2196 of 2317
Post > Topic >>

Re: Can awk, sed match mult-line patterns ?

by Ed Morton <morton@[EMAIL PROTECTED] > Mar 20, 2008 at 05:26 PM

On 3/20/2008 10:55 AM, problems@[EMAIL PROTECTED]
 wrote:
> It seems to me that sed & awk are single line based ?

sed is line-based, awk is record-based.

> I want to delete blocks of text which look like:
> <opening pattern>
> <2 to 5 lines>
> <closing pattern>

Use:

	awk -v RS="<closing pattern>" '...' file

to use "<closing pattern>" as the record separator.

> If I use the <2 to 5 lines>, I can avoid deleting all the good
> stuff, up to the 'next' <closing pattern> in case the assumed
> <closing pattern> is missing/undetected.

Post some sample input and expected output for more help.

	Ed.
 




 6 Posts in Topic:
Can awk, sed match mult-line patterns ?
problems@[EMAIL PROTECTED  2008-03-20 10:55:05 
Re: Can awk, sed match mult-line patterns ?
A Watcher <stocksami@[  2008-03-20 09:21:32 
Re: Can awk, sed match mult-line patterns ?
Ted Davis <tdavis@[EMA  2008-03-20 14:55:29 
Re: Can awk, sed match mult-line patterns ?
notbob <notbob@[EMAIL   2008-03-20 20:12:01 
Re: Can awk, sed match mult-line patterns ?
Ed Morton <morton@[EMA  2008-03-20 17:26:02 
Re: Can awk, sed match mult-line patterns ?
"Rajan" <svr  2008-03-23 19:28:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:45:13 CDT 2008.