Re: getting the line just before or after a pattern searched

2006-02-22 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > hi > > i have a file something like this > > abcdefgh > ijklmnopq > 12345678 > rstuvwxyz > . > . > . > 12345678 > . > > whenever i search the file and reach 12345678, how do i get the line > just above and below ( or more than 1 line above/below) the pa

Re: getting the line just before or after a pattern searched

2006-02-17 Thread Daniel Marcel Eichler
[EMAIL PROTECTED] wrote: >i have a file something like this > >abcdefgh >ijklmnopq >12345678 >rstuvwxyz >. >. >. >12345678 >. > >whenever i search the file and reach 12345678, how do i get the line >just above and below ( or more than 1 line above/below) the pattern >12345678 and s

Re: getting the line just before or after a pattern searched

2006-02-17 Thread Raymond Hettinger
[EMAIL PROTECTED] wrote: > hi > > i have a file something like this > > abcdefgh > ijklmnopq > 12345678 > rstuvwxyz > . > . > . > 12345678 > . > > whenever i search the file and reach 12345678, how do i get the line > just above and below ( or more than 1 line above/below) the patte

Re: getting the line just before or after a pattern searched

2006-02-17 Thread bonono
[EMAIL PROTECTED] wrote: > hi > > i have a file something like this > > abcdefgh > ijklmnopq > 12345678 > rstuvwxyz > . > . > . > 12345678 > . > > whenever i search the file and reach 12345678, how do i get the line > just above and below ( or more than 1 line above/below) the patt

Re: getting the line just before or after a pattern searched

2006-02-16 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > hi > > i have a file something like this > > abcdefgh > ijklmnopq > 12345678 > rstuvwxyz > . > . > . > 12345678 > . > > whenever i search the file and reach 12345678, how do i get the line > just above and below ( or more than 1 line above/below) the

getting the line just before or after a pattern searched

2006-02-16 Thread s99999999s2003
hi i have a file something like this abcdefgh ijklmnopq 12345678 rstuvwxyz . . . 12345678 . whenever i search the file and reach 12345678, how do i get the line just above and below ( or more than 1 line above/below) the pattern 12345678 and save to variables? thanks -- http://