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.