Yes, possible.

I don't know what your DNA strings might look like, or how big the input file may be. Those are relevant details that would need to be considered in crafting a solution. When indicating what a DNA string should look like, we would need to know if it can contain special characters embedded within it such as \n (newline), and if there is more than one per file. We could guess at that sort of thing, and enough DNA-related questions come up that we may actually get lucky and arrive at a sensible understanding of the problem. But it's better to be clear about it up front so we're not chasing a changing spec.

Once you isolate that (or those) DNA sequence(s) I suspect there might be additional information you also need to gather, so rather than give the specification in dribs and drabs, let's hear all of it.

Start out by reading perlintro, perlre and perlretut. Those will get you pointed in the right direction. Then take a stab at coming up with your own solution, and as you encounter hangups that you cannot get past, please do post them here with a small self-contained snippet of code (not necessarily your entire program, but enough code that we can run it). The snippet of code should be accompanied by sample input and expected output. You should then describe what problem you are having, and what aspect of the code you posted you cannot figure out. With such well-written questions we are happy to help.

If you want to learn Perl, we can help you get there. Good books include Learning Perl (OReilly) and Intermediate Perl (OReilly). And there's also the Learn Perl in about two hours and thirty minutes website that can really help too.

I would say the required reading for what you are trying to accomplish is at minimum that 2h30m website, and perlintro, and perlretut. That's about 4.5 hours of reading, which is not much to ask of someone who wants to learn to program, and who wants to enlist the help of those who have put in the time. Clearly it's only a start, but it will give you enough of a background to be able to ask sensible questions about those parts that are still opaque.


Dave


In reply to Re: how to isolate text in a text file. by davido
in thread how to isolate text in a text file. by undergradguy

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.