Chad Kellerman wrote:
>
>I was wondering if there is a one liner that searches a file for a
> string and then removes that line and the following four lines in the
> file?
grep 'string' -A 4 yourfile.txt | grep -v -f - yourfile.txt
:-)
John
--
use Perl;
program
fulfillment
--
To unsubs
On 9 Oct 2002, chad kellerman wrote:
> Perl gurus,
>
>I was wondering if there is a one liner that searches a file for a
> string and then removes that line and the following four lines in the
> file?
Any particular reason for a one-liner?
perl -i~ -pe '((/string/and$ln=$.)..($.-$ln==4))&&u
Perl gurus,
I was wondering if there is a one liner that searches a file for a
string and then removes that line and the following four lines in the
file?
Thanks,
Chad
--
Chad Kellerman
Jr. Systems Administrator
Alabanza Inc
410-234-3305
signature.asc
Description: This is a digitally si