tomatocans
asked on
HELP
#!/usr/bin/perl
open(IN,"</home/tmclaugh/l ist/text.t xt") || die "cannot open file>:!";
open(OUT,">/home/tmclaugh/ list/zinge r1.txt") || die "Cannot open
file>:!";
$/='ACCESSION NUMBER : ';
printf("%20s %20s %s\n",
"Accession Number",
"Word in Narrative",
"Sequence");
while(<IN>){
my ($an)= /(\d+)/g;
my @words;
($_)=/NARRATIVE\s+:(.+)\n\ w+\s+:/gs;
@words=/(\w+)(?!\n\w+\s:)/ gs;
my $i=0;
for my $word (@words){
$i++;
printf("%20s %20s %d\n",
$an,$word,$i);
}
}
close(IN);
close(OUT);
will not open or print to OUT can someone help
open(IN,"</home/tmclaugh/l
open(OUT,">/home/tmclaugh/
file>:!";
$/='ACCESSION NUMBER : ';
printf("%20s %20s %s\n",
"Accession Number",
"Word in Narrative",
"Sequence");
while(<IN>){
my ($an)= /(\d+)/g;
my @words;
($_)=/NARRATIVE\s+:(.+)\n\
@words=/(\w+)(?!\n\w+\s:)/
my $i=0;
for my $word (@words){
$i++;
printf("%20s %20s %d\n",
$an,$word,$i);
}
}
close(IN);
close(OUT);
will not open or print to OUT can someone help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER