Re: Deleting a line from one place and inserting it in another place

2011-07-19 Thread Shlomi Fish
Hello Melvin, next time please hit "Reply to all", because this message was sent only to me in private. I specifically request that in my signature: [QUOTE] > > > > Please reply to list if it's a mailing list post - http://shlom.in/reply . > > [QUOTE] Since you have not specified that this was s

Re: Deleting a line from one place and inserting it in another place

2011-07-17 Thread Shlomi Fish
Hi Melvin, On Fri, 15 Jul 2011 01:23:10 -0700 (PDT) Melvin wrote: > Hi All, > > I am a newbie to Perl. I wanted to write a below utility:- > > 1) Read a list of file names (from another file) > 2) Search for String1 (this is an entire line in the file names > obtained from the list) > 3) "gvi

Deleting a line from one place and inserting it in another place

2011-07-16 Thread Melvin
Hi All, I am a newbie to Perl. I wanted to write a below utility:- 1) Read a list of file names (from another file) 2) Search for String1 (this is an entire line in the file names obtained from the list) 3) "gvim-dd" or remove that line and insert it right after another line(after a string2) in

Re: Deleting a line that contains certain text

2003-09-08 Thread Scott R. Godin
David Wall wrote: > > > --On Saturday, September 06, 2003 7:45 PM -0400 perlwannabe > <[EMAIL PROTECTED]> wrote: > >> OK, I have a new problem. I need to delete an entire line that contains >> certain text. I have done an extensive search and had no luck finding an >> adequate answer. Yes, I

Re: Deleting a line that contains certain text

2003-09-07 Thread John W. Krahn
"R. Joseph Newton" wrote: > > "John W. Krahn" wrote: > > > > rename $file, "$file.bak" or die "Cannot move $file to $file.bak: $!"; > > I would say that this is the wrong place for the rename. Computers do crash. > If a crash occurs while this program is in progress, then he is left with a > re

Re: Deleting a line that contains certain text

2003-09-07 Thread R. Joseph Newton
"John W. Krahn" wrote: > > Also, I would like to run this from within a script instead of from the > > command line. > > > > BTW...using PERL 5.8.0 on Windows2000 Pro > > Here is one way to do it: > > use warnings; > use strict; > > my $file = shift or die "usage: $0 filename\n"; > > rename $file,

Re: Deleting a line that contains certain text

2003-09-06 Thread John W. Krahn
Perlwannabe wrote: > > OK, I have a new problem. I need to delete an entire line that contains > certain text. I have done an extensive search and had no luck finding an > adequate answer. Yes, I also saw the FAQ that just refers me to > Tie::file. The most promising solution was: > > perl -n

Re: Deleting a line that contains certain text

2003-09-06 Thread David Wall
--On Saturday, September 06, 2003 7:45 PM -0400 perlwannabe <[EMAIL PROTECTED]> wrote: OK, I have a new problem. I need to delete an entire line that contains certain text. I have done an extensive search and had no luck finding an adequate answer. Yes, I also saw the FAQ that just refers me

Deleting a line that contains certain text

2003-09-06 Thread perlwannabe
OK, I have a new problem. I need to delete an entire line that contains certain text. I have done an extensive search and had no luck finding an adequate answer. Yes, I also saw the FAQ that just refers me to Tie::file. The most promising solution was: perl -ni.bak -e 'print unless /FOO/;' inp

Re: search for string then deleting a line

2003-07-31 Thread Steve Grazzini
On Thu, Jul 31, 2003 at 09:32:32AM -0500, Distribution Lists wrote: > Can someone give me a clue > > I want to search through a file for a given string, when the string is > found then delete the whole line. For example There's a nice FAQ on this % perldoc -q 'change one line' > test.user:

search for string then deleting a line

2003-07-31 Thread Distribution Lists
Can someone give me a clue I want to search through a file for a given string, when the string is found then delete the whole line. For example test.user: cd9p06 search for "test.user", then delete "test.user: cd9p06" Thanks -- http://www.e-securenetworks.net http://www.shopper-holic.com htt

Re: Deleting a line

2001-12-07 Thread Scott R. Godin
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Mark McLogan) wrote: > Hi every body! > I don't know how i can delete a line of a file. > > Some body know? > > Thnk's perldoc -q delete print pack "H*", "4a75737420416e6f74686572204d61635065726c204861636b65722c0d"; -- Scott R. Godin

Deleting a line

2001-12-07 Thread Mark Mclogan
Hi every body! I don't know how i can delete a line of a file. Some body know? Thnk's _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

RE: Deleting a line

2001-12-07 Thread Wagner-David
get next line print FILEOUT $_; } close(FILEIN); close(FILEOUT); Wags ;) -Original Message- From: Mark Mclogan [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 08:34 To: [EMAIL PROTECTED] Subject: Deleting a line Hi everybody! somebody know how i can delete a

Deleting a line

2001-12-07 Thread Mark Mclogan
Hi everybody! somebody know how i can delete a line of a text file? i'm tryng some like this /^line1/d but i don't know the sintxs to execute some like this and i don't know if between "/" can be a variable ($_) Thak's all _

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