|laziness, impatience, and hubris|
Re: how to isolate text in a text file.by davido (Cardinal)
|on Dec 14, 2018 at 03:29 UTC||Need Help??|
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.