Ineffectual has asked for the wisdom of the Perl Monks concerning the following question:
1 899682 <B6>^E 1 899740 <B5>^E 1 899766 <B6>^E 1 899767 <B6>^E 1 899816 <B5>^E<B8>^E<BD>^E 1 899915 <B5>^E<B6>^E<B8>^E<BD>^E 1 899924 <B5>^E<B6>^E<B8>^E<BD>^E 1 900121 <B5>^E 1 900159 <B6>^E 1 900373 <B5>^E<B6>^E<B8>^E<BD>^E 1 900686 <B5>^E<B6>^E<BD>^E 1 900791 <B6>^E 1 900902 <B5>^E<B6>^E<B8>^E<BD>^E 1 900903 <B5>^E<B6>^E<B8>^E<BD>^E 1 901004 <B8>^E 1 901005 <B8>^E 1 901020 <B5>^E<B6>^E<B8>^E<BD>^E 1 901092 <B5>^E<B8>^E<BD>^E 1 901129 <B5>^E<B6>^E<B8>^E<BD>^E 1 901188 <B5>^E 1 901369 <B6>^E<B8>^E<BD>^E 1 901423 <B5>^E<BD>^E
my $lineCount = 0; foreach my $file (@whiFiles) { print "reading $file\n"; open IN, "gunzip -c $file |" or die "Can't open file $!"; while (<IN>) { next if ($_ =~ /^#/); chomp; my ($chr, $pos, $codes) = split(/\t/, $_); $lineCount++; } close IN; } print "Line count is $lineCount\n";
my $lineCount = 0; foreach my $file (@whiFiles) { print "reading $file\n"; my $HANDLE = new IO::Uncompress::AnyUncompress($file,Transparent = +> 1, AutoClose=>1) or die; while (<$HANDLE>) { next if ($_ =~ /^#/); chomp; my ($chr, $pos, $codes) = split(/\t/, $_); $lineCount++; } close $HANDLE; } print "Line count is $lineCount\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File read stopping prematurely
by kcott (Archbishop) on Aug 28, 2013 at 04:02 UTC | |
|
Re: File read stopping prematurely
by TJPride (Pilgrim) on Aug 28, 2013 at 04:26 UTC | |
by Ineffectual (Scribe) on Aug 30, 2013 at 00:51 UTC | |
|
Re: File read stopping prematurely
by pmqs (Friar) on Aug 28, 2013 at 12:09 UTC | |
by Ineffectual (Scribe) on Aug 30, 2013 at 00:56 UTC | |
|
Re: File read stopping prematurely
by Anonymous Monk on Aug 28, 2013 at 00:29 UTC | |
|
Re: File read stopping prematurely
by bitingduck (Deacon) on Aug 28, 2013 at 01:36 UTC | |
by Ineffectual (Scribe) on Aug 30, 2013 at 00:50 UTC |