I added some print statements, and now I am able to get the required contents in the output files. Thanks a lot!

Also, I have some mixed fasta header data. For eg:

>aw1.a1 bhi|tn|56564 pairs:40098 ATGCTAGATGCTAGCTAGCTAGCACTGAT CGATGCTAGCGTAGTCAGCTGATGCTGTA CGATGCTAGTCGTACG >aw1.b1 bhi|tn|56565 pairs:40099 CGAGCTAGTCGTAGTCGTGATGCTGATTA CGATGCTAGTCGTAGCTAGCTGATGCTGC CGATGCTAGTCGTAGTC >dd3.a1 bhi|tn|56566 pairs:40100 CGTAGTCGTAGTCGTAGTCGATGCTGATG GCTAGTCGATGCTAGCTAGTCGATGCTGG CGATGCTGAT >dd3.b1 bhi|tn|56567 pairs:40101 CGTAGTCGTAGTCGTACGTAGTCGTGAGT CGATTATTTAGGAGGGACAAGGATAGTA >hg5.a1 bhi|tn|56568 pairs:40102 CGTAGTCGTAGTCTAGTCGTGATGCTAGA >dfd6.a1 bhi|tn|56569 pairs:40103 CGATGCTACGTACGTAGTCAGTCGTGATG AATTAGAGCAGATAGAGGGGGAAAGGGTT AAACCCC >ght5.a1 bhi|tn|56564 ATGCTAGTCGTAGTCGATGTCGTAGCTGT CGTAGCTGATGCATGCTAGTCCGTAGCTG >tgt6.X bhi|tn|56564 pairs:56478 CGTAGCTGATGCTGATGCTGATGCTGTGT CGTAGCTGATGCTGATGCTTAGCTGATGC CGTAGCTGATCGTAGCTATCGTAGCTAGG >tgt6.Y bhi|tn|56564 pairs:56479 CGTAGTCGTAGTCGTAGTCGATGCTAGTG CGATGCTGATCGTGATGCTATGCTAGCGT CAGTCGTAGTCGTACGTAGTCGTGTGTGG

I want to write the complete header line (starting with '>') in my output files.

Can I use the split function to divide the header line into an array and then try printing it?

Thanks!


In reply to Re^4: Compare hash with arrays and print by ad23
in thread Compare hash with arrays and print by ad23

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.