i have a input file of the format
0000GH000
0000GH000
0000NM000
How would i extract GHGHNM from this input file using perl scripts
0000GH000
0000GH000
0000NM000
How would i extract GHGHNM from this input file using perl scripts
use strict;
open(DATA,"inputfile") or die "failed:$!";
my $str="";
while(<DATA>) {
chomp;
my $ch=$1 if(/(\D\D)/) ; # extract consecutive non-digits
print "$ch\n";
$str.=$ch; # append
}
print "$str";
Comment