Hi, i'm new in Perl. Now the problem. I've a file, that in some lines with the string "HEADER", every time that i found this I want to create a new file and Remove the line from the new file. The name of the output file would be the string "SEQUENCE .........." where "........" are the alphabets present after each header and the four letter code 1A9L. for eg. the input file looks like this

HEADER2 RNA 1998-04-07 1A9L EXPDTA NMR REMARK 0 RES. NO. 15 - 24 REMARK 0 SEQUENCE GUCGAGAGAC REMARK 0 2DSTRUCUTRE (((....))) REMARK 0 CHAIN A ATOM 455 P G A 15 53.709 19.513 10.553 1.00 2.13 + P ATOM 456 OP1 G A 15 54.206 19.249 11.925 1.00 2.47 + O ATOM 457 OP2 G A 15 53.091 20.834 10.264 1.00

and i want the output file to be named as GUCGAGAGAC and content should be

ATOM 455 P G A 15 53.709 19.513 10.553 1.00 2.13 + P ATOM 456 OP1 G A 15 54.206 19.249 11.925 1.00 2.47 + O ATOM 457 OP2 G A 15 53.091 20.834 10.264 1.00

please help


In reply to Create multiple files from a single file by PerlAmateur

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.