Yet another way...:

---------------------snip-----------------------
#!/usr/bin/perl -w
use strict;

open (FILE, "file_with_headings.txt") ||
                        die "Couldn't open \"file_with_headings.txt\" $!\n";
open (DIALIGN, ">dialign.txt") ||
                                die "Couldn't create \"dialign.txt\" $!\n";
open (FASTA, ">fasta.txt") || die "Couldn't create \"fasta.txt\" $!\n";
open (TREE, ">sequence_tree.txt") ||
                      die "Couldn't create \"sequence_tree.txt\" $!\n";
while (<FILE>) {
    print DIALIGN if (/DIALIGN/ .. /FASTA/);
    print FASTA if (/FASTA/ .. /Sequence tree/);
    print TREE if (/Sequence tree/ .. eof);
}
close (DIALIGN);
close (FASTA);
close (TREE);
---------------------snip-----------------------

Ron Smith

>From: Pedro A Reche Gallardo <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>,         "[EMAIL PROTECTED]" 
><[EMAIL PROTECTED]>
>Subject: split a file
>Date: Tue, 21 Aug 2001 18:24:44 -0400
>
>Hi  All, I have a file (see below) that I would like to split in three
>files: One file for the  information under  "Alignment (DIALIGN
>format)", another for  the information under  the line "Alignment (FASTA
>format)" and a third one for the information under sequence tree.
>Any help to do this will be appreciated.
>
>
>Cheers
>
>    Alignment (DIALIGN format):
>    ===========================
>
>
>gi|38145|e    1   MALPVTALLL PLALLLHAAR ---PSQFRVS PLDRTWNLGE TVELKCQVLL
>
>gi|7438693    1   MALPVTALLL PLALLLHAAR ---PSQFRVS PLDRTWNLGE TVELKCQVLL
>
>                   ********** **********    ******* ********** **********
>
>                   ********** *********     ******* ********** **********
>
>
>
>    Alignment (FASTA format):
>    =========================
>
>
> >gi|38145|emb|CAA4278
>MALPVTALLLPLALLLHAAR---PSQFRVSPLDRTWNLGETVELKCQVLL
>SNPTSGCSWLFQPRGAAASPTFLLYLSQNKPKAAEGLDTQRFSGKRLGDT
> >gi|7438693|pir||S256
>MALPVTALLLPLALLLHAAR---PSQFRVSPLDRTWNLGETVELKCQVLL
>
>
>    Sequence tree:
>    ==============
>
>
>((gi|38145|emb|CAA4278:0.003018,
>gi|7438693|pir||S256:0.003018):0.002338,
>gi|1168854|sp|P41688:0.005357);
>
>***************************************************************************
>PEDRO a. RECHE gallardo, pHD            TL: 617 632
>3824
>Scientist, Mol.Immnunol.Foundation,     FX: 617 632 3351
>Dana-Farber Cancer Institute,           EM:
>[EMAIL PROTECTED]
>Harvard Medical School,                 EM:
>[EMAIL PROTECTED]
>44 Binney Street, D610C,                URL:
>http://www.reche.org
>Boston, MA 02115
>***************************************************************************
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to