in reply to compare columns in all possible combination
use Inline::Files; push @b, [split ' '] for <FILEB>; while (@a = split ' ', <FILEA>){ --$_ for @a; print "@{$b[0]}[@a]\n"; for $i (1.. $#b) { undef @h{@{$b[$i]}[@a]}; $s++ if scalar keys %h == 1; undef %h; } print "$s\n" if $s; undef $s; } __FILEA__ 1 2 3 4 1 2 3 5 1 2 4 5 1 3 4 5 2 3 4 5 __FILEB__ A B C D E 0 0 0 + 0 + 0 + + + 0 + + + + 0 0 + + 0 + + + + + 0 + + + + + 0 + + 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compare columns in all possible combination
by greeknlatin (Initiate) on Sep 21, 2014 at 10:01 UTC | |
by Lennotoecom (Pilgrim) on Sep 21, 2014 at 15:09 UTC | |
by greeknlatin (Initiate) on Sep 21, 2014 at 15:19 UTC | |
by Lennotoecom (Pilgrim) on Sep 21, 2014 at 16:33 UTC |