in reply to Re: Creating a Hash using only one column in an imported data file
in thread Creating a Hash using only one column in an imported data file
Thank you very much!! This was very helpful information. However, my data file is way too large to be able to use inside the code. I tried running it with the format below, and i'm getting 0 values are greater than x for all of the elements. Is there something wrong with the way i'm opening the file?
open (IN, "<$ARGV[0]") || die ("Cannot open $ARGV[0]: $!"); @MyData = <IN>; use strict; use warnings; use feature 'say'; my @col9 = map {(split)[8]} <IN>; foreach my $test (2,3,4,5,6,7,8,9) { my $count =scalar grep {$_ >= $test} @col9; say sprintf "%d values were >= %d", $count, $test; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating a Hash using only one column in an imported data file
by 1nickt (Canon) on Feb 13, 2017 at 21:27 UTC | |
by Koda1234 (Initiate) on Feb 13, 2017 at 22:25 UTC | |
by 1nickt (Canon) on Feb 13, 2017 at 22:30 UTC | |
by Koda1234 (Initiate) on Feb 13, 2017 at 22:44 UTC | |
by 1nickt (Canon) on Feb 13, 2017 at 22:59 UTC |