in reply to spliting a table into individual columns
Some notes:#!/usr/bin/perl use warnings; use strict; sub read_TABLE { my ( $filename ) = @_; open( TBL, $filename ) or die "cannot open $filename: $!\n"; my @table; while ( <TBL> ) { chomp; push @table, [ split( /\t/, $_ , 5 ) ]; } close TBL; return @table; } for my $row ( read_table( "TABLE.txt" )) { my ( $start, $end, $name, $strand, $type ) = @$row; print "$type\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: spliting a table into individual columns
by C_elegance (Initiate) on Dec 21, 2007 at 11:43 UTC | |
|
Re^2: spliting a table into individual columns
by C_elegance (Initiate) on Dec 21, 2007 at 12:49 UTC | |
|
Re^2: spliting a table into individual columns
by C_elegance (Initiate) on Dec 21, 2007 at 13:29 UTC | |
by naChoZ (Curate) on Dec 21, 2007 at 15:59 UTC | |
by graff (Chancellor) on Dec 22, 2007 at 06:27 UTC | |
by C_elegance (Initiate) on Dec 22, 2007 at 08:10 UTC | |
by graff (Chancellor) on Dec 24, 2007 at 17:52 UTC | |
by C_elegance (Initiate) on Dec 22, 2007 at 08:39 UTC |