Re: removal of a line in a file

2002-10-09 Thread John W. Krahn
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

Re: removal of a line in a file

2002-10-09 Thread Sudarshan Raghavan
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

removal of a line in a file

2002-10-09 Thread chad kellerman
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