The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
URGENT: Script/Function needed to read text property files in block wise ysreenivas Shell Programming and Scripting 7 05-11-2009 04:08 AM
Deleting lines in text file hern14 UNIX for Dummies Questions & Answers 5 05-16-2008 04:03 PM
Delete a block of text delimited by blank lines when pattern is found gleu Shell Programming and Scripting 17 12-16-2007 11:30 PM
Deleting text from a file n8575 Shell Programming and Scripting 1 02-08-2006 10:03 AM
using sed(?) to delete a block of text toast Shell Programming and Scripting 3 10-23-2005 02:30 AM

Closed Thread
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
  #1 (permalink)  
Old 02-27-2007
andre123 andre123 is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 1
Deleting text block in file

Need to delete a text block inside a file, that is marked with a start and an end pattern. Eg

do not delete
not delete
<tag1>
delete everything here
here
and here
and here...
<tag2>
do not delete
do not delete....

Believe sed is able to do this job but don't get it working.

Regards Andre
  #2 (permalink)  
Old 02-27-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Code:
 sed "/<tag1>/,/<tag2>/ d" file
Closed Thread

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 07:54 PM.


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