Re: [OT:style]deleting a line with a particular string.

2001-06-29 Thread Michael Fowler
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

RE: [OT:style]deleting a line with a particular string.

2001-06-29 Thread Peter Scott
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.

RE: [OT:style]deleting a line with a particular string.

2001-06-29 Thread Sam Lander
>> 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

Re:[OT:style]deleting a line with a particular string.

2001-06-28 Thread Paul
--- 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: >

Re: deleting a line with a particular string.

2001-06-28 Thread Me
> 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

RE: deleting a line with a particular string.

2001-06-28 Thread John Edwards
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

RE: deleting a line with a particular string.

2001-06-28 Thread Ronald J. Yacketta
> 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

deleting a line with a particular string.

2001-06-28 Thread Deepesh Tiwari
--- 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