Training, Open Source
computer languages


PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
file writing

Posted by rick (rick), 10 October 2007
how to open a file,match some data from it,extract the data which matched and save/write it to another file?
for example in a fasta fomat DNA dequence,I want to remove all the header lines and store them to a separate file.

Posted by admin (Graham Ellis), 10 October 2007
Well .... this is the sort of thing you can do ....

Code:
open (FH,"requests.xyz") or die;
open (FHO,">pythoners.xyz") or die;
while (<FH>) {
       /Python/ and print FHO;
       }


... but I am concerned that you'll really need to learn a lot more basics to tailor this to do what you need.   I can recommend either this or a good book, but learning all of Perl via a question and answer session isn't very practical.

Posted by KevinAD (KevinAD), 10 October 2007
I recommend anyone working with DNA stuff checks out bioperl:

www.bioperl.org



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.


WELL HOUSE CONSULTANTS LTD.: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho