X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fread_tab;h=a8dede9d9ce979fb12c20718de8c993b1027cf2b;hb=5de6112b70b59420b245ce636a8b2e3c90acbe00;hp=6517c0c0df48e5c4d1fefc47fcbe8ba923a9ef91;hpb=b16eaa5850a9f86013e6b0b57a5f3b8ea29fb639;p=biopieces.git diff --git a/bp_bin/read_tab b/bp_bin/read_tab index 6517c0c..a8dede9 100755 --- a/bp_bin/read_tab +++ b/bp_bin/read_tab @@ -1,4 +1,4 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # Copyright (C) 2007-2009 Martin A. Hansen. @@ -26,9 +26,10 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +use warnings; use strict; +use Data::Dumper; use Maasha::Filesys; -use Maasha::Fasta; use Maasha::Biopieces; @@ -64,15 +65,24 @@ if ( $options->{ 'data_in' } ) while ( $line = <$data_in> ) { + chomp $line; + if ( $skip ) { $skip--; next; } - next if $line =~ /^#|^$/; + 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;