Solved

HELP

Posted on 2000-02-16
2
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…

730 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