RE: How to substitute "# "

2002-10-10 Thread NYIMI Jose (BMB)
Just a idea : #!/usr/bin/perl -w use strict; my $old_file="address.txt"; open(OLD,$old_file) || die "can not open $old_file for reading: $!"; while(){ s/\#(.+)$/Apt $1/ if /.ADDRESS\s+1/; print; } __END__ José. > -Original Message- > From: Zary Necheva [mailto:[EMAIL

Re: How to substitute "# "

2002-10-10 Thread dan
$variable = "..ADDRESS 1 OR 2"; # here you'll need to assign the variable perl will check to see if it's address 1 or address 2 from the file. if ($variable eq "..ADDRESS 1" ) { s/\#/Apt/g; # subs # for "Apt" s/\(//g; # removes ( s/\)//g; # removes ) } some clever regex expert may be