X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fread_tab;h=a8dede9d9ce979fb12c20718de8c993b1027cf2b;hb=48bea5c28b89dc5586d0bddb338ccd6ba23aa1f9;hp=cf37a12b3b3496136a152d6cf86b5fa52415b711;hpb=5aed4676ad1bf35abbade6215ac90ee591e6d8fe;p=biopieces.git diff --git a/bp_bin/read_tab b/bp_bin/read_tab index cf37a12..a8dede9 100755 --- a/bp_bin/read_tab +++ b/bp_bin/read_tab @@ -26,7 +26,9 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +use warnings; use strict; +use Data::Dumper; use Maasha::Filesys; use Maasha::Biopieces; @@ -63,15 +65,24 @@ if ( $options->{ 'data_in' } ) while ( $line = <$data_in> ) { + chomp $line; + if ( $skip ) { $skip--; next; } - next if $line =~ /^#|^$/; # skip comment lines beginning with # and skip empty lines. + next if $line =~ /^$/; # skip empty lines. - chomp $line; + if ( $line =~ /^#.+/ and not defined $options->{ 'keys' } ) + { + $line = substr $line, 1; + + $options->{ 'keys' } = [ split /$options->{'delimit'}/, $line ]; + + next; + } undef $record; undef @fields2;