On Fri, Jun 29, 2001 at 10:21:31AM +1000, Sam Lander wrote:
> I wanted to do this just today. Although, I want to tidy up the resulting
> line a bit by deleting everything before a colon, so I tried this:
>perl -ne "/string/ && print s/.*://" file
> I was surprised that I got this:
>1
At 10:21 AM 6/29/01 +1000, Sam Lander wrote:
> >> At a shell prompt / command line, enter:
> >>
> >> perl -ne '/string/ or print' file
> >>
> >> where string is the string and file is the file.
> >
> >I prefer 'print unless /string/'.
> >As if it matters. ;o]
>
>I wanted to do this just today.
>> At a shell prompt / command line, enter:
>>
>> perl -ne '/string/ or print' file
>>
>> where string is the string and file is the file.
>
>I prefer 'print unless /string/'.
>As if it matters. ;o]
I wanted to do this just today. Although, I want to tidy up the resulting
line a bit by de
--- Me <[EMAIL PROTECTED]> wrote:
> > I have a file having 100 lines.
> > I want to remove the lines, having a particular string, completely
> > from the file. (notreplacing them with blank lines even)
> >
> > Is there a way in perl for doing this ?
>
> At a shell prompt / command line, enter:
>
> I have a file having 100 lines.
> I want to remove the lines, having a particular string, completely
from the
> file. (notreplacing them with blank lines even)
>
> Is there a way in perl for doing this ?
At a shell prompt / command line, enter:
perl -ne '/string/ or print' file
where stri
create $changed: $!";
while() {
print OUT unless /$changed/;
}
close IN;
close OUT;
HTH
John
-Original Message-
From: Deepesh Tiwari [mailto:[EMAIL PROTECTED]]
Sent: 28 June 2001 16:13
To: [EMAIL PROTECTED]
Subject: deleting a line with a particular string.
---
I have a file
> I have a file having 100 lines.
> I want to remove the lines, having a particular string,
> completely from the
> file. (not replacing them with blank lines even)
>
> Is there a way in perl for doing this ?
most defiantly, tho I am a novice at perl right now.
I have sent this to the beginner
---
I have a file having 100 lines.
I want to remove the lines, having a particular string, completely from the
file. (notreplacing them with blank lines even)
Is there a way in perl for doing this ?
--deepesh