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
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
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
"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
"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,
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
--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
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
Depending on what you are after, there is a number of ways from one-liners to
whatever.
In most basic form, you will need to open file to read, another file to write.
Using the regex or some type of test to determine if a line is to be
re-written to the file or not.
> 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
$original = "c:\\myfile.txt";
$changed = "c:\\mynewfile.txt";
$searchfor = "john"; # Text identifying line(s) you want removing
open IN, $original or die "Can't open $original: $!";
open OUT, ">$changed" or die "Can't create $changed: $!";
while() {
print OUT unless /$changed/;
}
close
> 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
12 matches
Mail list logo