different take on common ?: search for two strings and remove lines between them

Thank you for assisting,

I've got a partial solution just needs a tweak.

Hulk-BASH$ cat somefile.txt
oh there is some stuff here
some more stuff here
START_LABEL
stuff I want
more stuff I want
END_LABEL
other stuff here too
and even more stuff here too
Hulk-BASH$

Hulk-BASH$ sed -n '/^START_LABEL/,/^END_LABEL/p' somefile.txt
START_LABEL
stuff I want
more stuff I want
END_LABEL
Hulk-BASH$

As you can see it's editing properly but I need the output to have the "LABELS" themselves removed so it looks like:

stuff I want
more stuff I want

Thanks for your help

L.

cat test | awk -F 'START_LABEL' 'BEGIN{RS="END_LABEL"; OFS="\n"; ORS=""} {print $2}'

Thank you Ikon, but I received this:

Hulk-BASH$ cat somefile.txt | awk -F 'START_LABEL' 'BEGIN{RS="END_LABEL"; OFS="\n"; ORS=""} {print $2}'
awk: syntax error near line 1
awk: bailing out near line 1
Hulk-BASH$

thx

Try this:

awk '/^START_LABEL/{p=1;next}/^END_LABEL/{exit}p' file

Regards

Wow I wonder what is up, still same errors, I'm using Solaris
Thx Franklin

Hulk-BASH$ awk '/^START_LABEL/{p=1;next}/^END_LABEL/{exit}p' somefile.txt
awk: syntax error near line 1
awk: bailing out near line 1
Hulk-BASH$

as always on Solaris, use 'nawk' instead of 'awk'.

Hi,

sed is fine, simply add some characters, e.g.:

sed -n '/^START_LABEL/,/^END_LABEL/{/LABEL$/!p}' somefile 

Which means: of all the files between the LABEL print only line not
matching LABEL at the end.

HTH Chris

As vgersh99 mentioned, use nawk or /usr/xpg4/bin/awk on Solaris.

Regards

Thank you very much guys and to everyone who helped me.

Kind of weird about the whole awk vs. nawk in Solaris
I've got scripts that use awk (on Solaris) yet for the following I must use nawk
Anyway the code below works when substituting awk w/ nawk.

##nawk works
Hulk-BASH$ nawk '/^START_LABEL/{p=1;next}/^END_LABEL/{exit}p' somefile.txt
stuff I want
more stuff I want

Hulk-BASH$ awk '/^START_LABEL/{p=1;next}/^END_LABEL/{exit}p' somefile.txt
awk: syntax error near line 1
awk: bailing out near line 1
Hulk-BASH$

Thank you very much you guys have no idea as I'm new to sed and awk/nawk and I still find all this stuff foreign.

L.