Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Need help to write a Perl one liner for an input file that is slightly different frmo the one descried at the URL:

My input file looks as follows:

contig_7643 IMGAG CDS 163 441 . + 0 ID=contig_7643_1.1_cds_1;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 525 617 . + 0 ID=contig_7643_1.1_cds_2;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 807 914 . + 0 ID=contig_7643_1.1_cds_3;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 1589 1703 . + 0 ID=contig_7643_1.1_cds_4;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 1793 1926 . + 2 ID=contig_7643_1.1_cds_5;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 2027 2128 . + 0 ID=contig_7643_1.1_cds_6;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 2214 2306 . + 0 ID=contig_7643_1.1_cds_7;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 2393 2528 . + 0 ID=contig_7643_1.1_cds_8;Parent=contig_7643_1.1

contig_7643 IMGAG CDS 2616 2728 . + 2 ID=contig_7643_1.1_cds_9;Parent=contig_7643_1.1

contig_7643 IMGAG 5'-UTR 67 162 . + 2 ID=contig_7643_1.1_cds_9;Parent=contig_7643_1.1

contig_7643 IMGAG 3'-UTR 2729 3172 . + 2 ID=contig_7643_1.1_cds_9;Parent=contig_7643_1.1

Could someone please help me with a one liner Perl / bash script that reports only those IDs that contain both 5'-UTR and 3'UTR in the input file? Note that what look like spaces between columns in the example input are actually tab separators

Thanks a ton!

In reply to Perl one liner help by onlyIDleft

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (3)
    As of 2018-05-22 23:53 GMT
    Find Nodes?
      Voting Booth?