Rob Coops wrote:
open (IN, "+;
close IN;
for ( my $i = 0; $i < scalar @file; $i++ ) { # loop trought the file line by
line
if ( $file =~ m/$ARGV0/g ) { # look for argument $ARGV0
$file =~ s/$ARGV0(\b.*)/$ARGV1$1/g; # replace argument $ARGV0 with $ARGV1
$file =~
s/(.*?)(\d{2}/\d{2}/\d{2}
brian54321uk wrote:
brian54321uk wrote:
Rob Dixon wrote:
brian54321uk wrote:
Hi, I'm stuck with what will probably turn out to be a simple
solution, I've been scouring google for ages, and can't find
anything close to what I'm looking for.
Given that
$fred = 10
$bar
brian54321uk wrote:
Rob Dixon wrote:
brian54321uk wrote:
Hi, I'm stuck with what will probably turn out to be a simple
solution, I've been scouring google for ages, and can't find anything
close to what I'm looking for.
Given that
$fred = 10
$barney = abcdefghijklmn
brian54321uk wrote:
Rob Dixon wrote:
brian54321uk wrote:
Hi, I'm stuck with what will probably turn out to be a simple
solution, I've been scouring google for ages, and can't find anything
close to what I'm looking for.
Given that
$fred = 10
$barney = abcdefghijklmn
Rob Dixon wrote:
brian54321uk wrote:
Hi, I'm stuck with what will probably turn out to be a simple solution,
I've been scouring google for ages, and can't find anything close to
what I'm looking for.
Given that
$fred = 10
$barney = abcdefghijklmn
how do I get $w
John W. Krahn wrote:
brian54321uk wrote:
Hi,
Hello,
I'm stuck with what will probably turn out to be a simple solution,
I've been scouring google for ages, and can't find anything close to
what I'm looking for.
Given that
$fred = 10
$barney = abcdefghijklmn
how
Rob Dixon wrote:
brian54321uk wrote:
Hi, I'm stuck with what will probably turn out to be a simple solution,
I've been scouring google for ages, and can't find anything close to
what I'm looking for.
Given that
$fred = 10
$barney = abcdefghijklmn
how do I get $w
Hi, I'm stuck with what will probably turn out to be a simple solution,
I've been scouring google for ages, and can't find anything close to
what I'm looking for.
Given that
$fred = 10
$barney = abcdefghijklmn
how do I get $wilma = j
Thanks
Brian
--
To unsubscribe, e-mail: [EMAIL PROTECTE
[EMAIL PROTECTED] wrote:
Here's another way, but not necessarily the best Perl, but it does work:
#!/usr/bin/env perl
use strict;
use warnings;
my @filelist=;
chomp @filelist;
my $match_strings=qr '(abc123blue|xyz357green)';
my ($file, );
foreach $file (@filelist) {
#print "file=$file\n";
Is
Peter Scott wrote:
On Fri, 05 Sep 2008 19:09:25 +0100, brian54321uk wrote:
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
One way:
use strict;
use warnings
Aruna Goke wrote:
brian54321uk wrote:
Aruna Goke wrote:
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the
John W. Krahn wrote:
Dr.Ruud wrote:
brian54321uk schreef:
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
I would use `grep -l` to get the list of filenames
John W. Krahn wrote:
Aruna Goke wrote:
brian54321uk wrote:
Aruna Goke wrote:
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file
contains abc123blue or xyz357green then that file is to be
HI again
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
If however, it would be simpler for the script to empty the files
contents, that's not a problem as I hav
d, 2008-09-03 at 16:47 +0100, brian54321uk wrote:
> Just tested this out and unfortunately instead of dirname replacing
> abc123, I get a .
That's because the dirname is a '.'
Try:
use Cwd;
if( (my $dir = dirname( $file )) eq '.' ){
Mr. Shawn H. Corey wrote:
On Wed, 2008-09-03 at 14:55 +0100, brian54321uk wrote:
Hi
I would like to replace a string of characters in a file to the name of
the directory it is in.
Thefore, in the example below, I would like to know how to replace "?"
open( F, $ARGV[0] );
while(
Hi
I would like to replace a string of characters in a file to the name of
the directory it is in.
Thefore, in the example below, I would like to know how to replace "?"
open( F, $ARGV[0] );
while( ) {
s!abc123!?!;
s!xyz123!123xyz!;
{
print;
}
}
Any help much appreciated.
Brian
17 matches
Mail list logo