The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remove matching lines with list of strings Nanu_Manju Shell Programming and Scripting 6 10-29-2008 05:11 AM
using AWK see the upper lines and lower lines of the strings?? thepurple Shell Programming and Scripting 3 10-07-2008 11:24 AM
Copying common lines to a new file khestoi UNIX for Dummies Questions & Answers 3 09-12-2008 06:31 PM
To find all common lines from 'n' no. of files The Observer Shell Programming and Scripting 11 06-16-2008 03:22 PM
how to take out common of two lines in a file jam_ali49 UNIX for Advanced & Expert Users 6 11-23-2007 04:48 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-03-2008
laser laser is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 7
different take on common ?: search for two strings and remove lines between them and

Thank you for assisting,

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


Code:
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.

Last edited by laser; 12-03-2008 at 04:35 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0