Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete text between two paterns in file, UNIX

Status
Not open for further replies.

OraW

Programmer
Mar 9, 2004
1
IL
Hello,

I would like to know, how to delete text between two paterns in file, OS=Unix.

For example:
source:

AAAAAA STORAGE
DDDD TABLESPACE BBBB

target:
AAAAAA
DDDD BBBB

Regards, Ora.
 
between two paterns
What are the 2 patterns ?
What is the meaning of target, desired output ?
Assuming that patterns are STORAGE and TABLESPACE, that the word between in the above quote is meaningless and that target is the expected result, try something like this:
sed -e 's!STORAGE!!g;s!TABLESPACE!!g' /path/to/inputfile

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top