Re: [SLUG] extract a block of text between tags.

From: btt@nethouse.com
Date: Fri Jul 25 2003 - 17:52:24 EDT


On Fri, Jul 25, 2003 at 12:13:11PM -0700, Michael Manchester wrote:
> I would like to extract some text from a file that is
> between tags. Such as
> begin
> ....
> .... some text
> ....
> end
> I thought I had seen somewhere away to use grep, sed
> or awk to extect the sometext between the tags. But
> google searches are coming up empty as is my memory.
> Does anyone have away to do this?

I doubt this is what you want, but it is friday so here goes.

$ cat file | perl -00 -ne 's/begin\n(.+?)end/print($1)/se'

Muahahah... :)

Cheers,
Bill



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:56:55 EDT