#!/usr/bin/perl use strict; use warnings; my (@cluster1, @cluster2); open FILE, 'dataset.txt'; while (<FILE>){ my @cols = split /\s+/; if ($cols[0] =~ m/\d/){ if ($cols[2] < 200){ push @cluster1, [@cols]; } else { push @cluster2, [@cols]; } } } # simple test to make sure it worked. foreach my $row (@cluster1) { #print "$cluster1[$row]\n"; print "@$row\n"; }
In reply to Re: how to get clusters?
by starX
in thread how to get clusters?
by sirna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |