[Bioperl-l] parse columns file

Jordi Durban jordi.durban at gmail.com
Mon Feb 14 11:34:36 UTC 2011


Thank you very much John. The output should be the two fields from each
entry. In the example above, it should be:
*uaccno=FF56QEU12HD1LC *   *gi|166216293|sp|P0C616.1|PA2HA_BOTAS
**uaccno=FF56QEU12HMBY2*    *gi|166216293|sp|P0C616.1|PA2HA_BOTAS *
*uaccno=FF56QEU12HDB9V *  * gi|166215047|sp|P24605.3|PA2H2_BOTAS

*According to http://perl.about.com/od/filesystem/a/perl_parse_tabs.htm I
have to do:

open (FILE, 'data.txt');
 while (<FILE>) {
 chomp;
 ($name, $email, $phone) = split("\t");
 print "Name: $name\n";
 print "Email: $email\n";
 print "Phone: $phone\n";

 print "---------\n";
 }

 close (FILE);

But this script doesn't deal with the duplicated lines...

2011/2/14 John SJ Anderson <genehack at genehack.org>

> On Mon, Feb 14, 2011 at 05:41, Jordi Durban <jordi.durban at gmail.com>
> wrote:
> > Hi all!
> > I'm trying to parse a three columns file. The first one could be
> repeated.
> > However, I would like to obtain the results for the first one.
> [ snip ]
>
> You've given us the input. What should the output look like?
>
> j.
>



-- 
Jordi



More information about the Bioperl-l mailing list