Brian wrote:
John W. Krahn wrote:
Brian wrote:
Partial success.
The value search for is normally located starting at the 35th char
into the line.
I split the line so it was at the beginning of a new line and
replace with worked.
Unfortunately the dates never changed.
I will sleep on this
John W. Krahn wrote:
Brian wrote:
Partial success.
The value search for is normally located starting at the 35th char
into the line.
I split the line so it was at the beginning of a new line and replace
with worked.
Unfortunately the dates never changed.
I will sleep on this and attack it
Hi
ARGV0 will = AB7Z001
ARGV1 will = AB7Z002
ARGV2 will = 01/01/1900
I would like to read a file, locate AB7Z001 (but not AB7Z0011, so a space at
position 8 in string )
Upon location of value in argv0 replace it with argv1.
Then, at the first instance of a date replace it with argv2.
Then, at
On Wed, Oct 22, 2008 at 3:38 PM, Brian [EMAIL PROTECTED] wrote:
Hi
ARGV0 will = AB7Z001
ARGV1 will = AB7Z002
ARGV2 will = 01/01/1900
I would like to read a file, locate AB7Z001 (but not AB7Z0011, so a space
at position 8 in string )
Upon location of value in argv0 replace it with argv1.
From: Rob Coops [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Wednesday, October 22, 2008 3:24:12 PM
Subject: Re: Conditional replace
On Wed, Oct 22, 2008 at 3:38 PM, Brian [EMAIL PROTECTED] wrote:
Hi
ARGV0 will = AB7Z001
ARGV1 will = AB7Z002
ARGV2
Rob Coops wrote:
snip
open (IN, +dummy.txt);
@file = 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 =~
Brian wrote:
Hi
Hello,
ARGV0 will = AB7Z001
ARGV1 will = AB7Z002
ARGV2 will = 01/01/1900
I would like to read a file, locate AB7Z001 (but not AB7Z0011, so a space at
position 8 in string )
Upon location of value in argv0 replace it with argv1.
Then, at the first instance of a date replace
John W. Krahn wrote:
Brian wrote:
Hi
Hello,
snip
#!/usr/bin/perl
use warnings;
use strict;
@ARGV == 3 or die usage: $0 search for replace with date\n;
my ( $search, $replace, $date ) = @ARGV;
my ( $day, $mon, $year ) = ( localtime )[ 3, 4, 5 ];
my $today = sprintf '%02d/%02d/%04d',
Brian wrote:
John W. Krahn wrote:
Brian wrote:
Hi
Hello,
snip
#!/usr/bin/perl
use warnings;
use strict;
@ARGV == 3 or die usage: $0 search for replace with date\n;
my ( $search, $replace, $date ) = @ARGV;
my ( $day, $mon, $year ) = ( localtime )[ 3, 4, 5 ];
my $today = sprintf
Brian wrote:
Brian wrote:
John W. Krahn wrote:
Brian wrote:
Hi
Hello,
snip
#!/usr/bin/perl
use warnings;
use strict;
@ARGV == 3 or die usage: $0 search for replace with date\n;
my ( $search, $replace, $date ) = @ARGV;
my ( $day, $mon, $year ) = ( localtime )[ 3, 4, 5 ];
my $today =
Brian wrote:
Brian wrote:
John W. Krahn wrote:
Brian wrote:
snip
#!/usr/bin/perl
use warnings;
use strict;
@ARGV == 3 or die usage: $0 search for replace with date\n;
my ( $search, $replace, $date ) = @ARGV;
my ( $day, $mon, $year ) = ( localtime )[ 3, 4, 5 ];
my $today = sprintf
Brian wrote:
Partial success.
The value search for is normally located starting at the 35th char
into the line.
I split the line so it was at the beginning of a new line and replace
with worked.
Unfortunately the dates never changed.
I will sleep on this and attack it again in the morning.
12 matches
Mail list logo