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
Deleting lines from a file Nirgude07 UNIX for Advanced & Expert Users 11 07-01-2009 02:09 PM
deleting particular lines and moving a line up using perl/sed sabyasm Shell Programming and Scripting 5 12-12-2007 05:59 PM
deleting lines using awk-best way? satnamx Shell Programming and Scripting 3 08-29-2007 07:24 PM
deleting lines ajnabi Shell Programming and Scripting 8 05-02-2003 11:50 AM
deleting lines supercbw High Level Programming 1 05-06-2002 12:53 PM

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 10-11-2007
eltinator eltinator is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 63
Deleting lines above a certain line

Hi,

I have a file that gets automatically generated and it would look something like

sakjsd
adssad
{{word}}

sddsasd
dsdsasa
.
.
.


So basically what I want to do is just keep the stuff below the {{word}} marker. The marker includes the brackets. Is there any command to delete the "{{word}}" and everything above it and just keep what is below it? Thanks!
  #2 (permalink)  
Old 10-11-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Code:
sed '1,/{{word}}/d' myFile
  #3 (permalink)  
Old 10-11-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,513
Code:
awk '/{{word}}/{f=1;next}f' file
  #4 (permalink)  
Old 10-11-2007
eltinator eltinator is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 63
cool thanks a bunch!
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 05:08 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