The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 09-10-2007
ranga27 ranga27 is offline
Registered User
 

Join Date: May 2006
Posts: 63
Hi

Thanks for the replies

Just wanted to be clear

lets assume i have a file1.txt which has the following

aaa
bbb
bbb
ccc
qqq
343
454
eee

i am looking for a string 343 once the script finds 343 it should delete 4 lines above it and 2 lines below it

the output file should be

qqq

Thanks
Reply With Quote