Solved

HELP

Posted on 2000-02-16
2
171 Views
Last Modified: 2010-03-05
#!/usr/bin/perl

                                  open(IN,"</home/tmclaugh/list/text.txt") || die "cannot open file>:!";
                                  open(OUT,">/home/tmclaugh/list/zinger1.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
0
Comment
Question by:tomatocans
2 Comments
 
LVL 1

Accepted Solution

by:
olthoff earned 0 total points
ID: 2531106
printf(OUT "%20s %20s %d\n",$an,$word,$i);
0
 

Author Comment

by:tomatocans
ID: 2538628
Thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question