Ok, now I'm more confused than ever and chasing my tail in frustration. This is where I am with the code. Any helpful suggestions are appreciated.
#!/usr/bin/perl #22/06/2011 #use strict; use warnings; use File::Slurp; use Data::Dumper; my @data; my @col; my $dataset; my @fields; #my %out; my $Hashref; my $fileCount; my @out; my @results; open INFILE, "<Primer-Rev1" or die $!; open my $outfh, '>', "outputfile.txt" or die $!; for my $nr (1..2) { for my $line (read_file('Primer-For'.$nr)) { my @col = split(/\t/,$line); push @{$data[$nr - 1]->{shift(@col)}},\@col; } } while (<INFILE>){ @col = split(/\t+/, $_); chomp (@col); my ($header, $length, $tm, $sequence) = @col[0..3]; # expecting file3 line in @col my @results = ( $col[1], $col[2] ); #print Dumper (\@results) } for my $dataset (@data) { my @out = push @{ $data[ $fileCount ]->{ shift @col } }, \@col; #print Dumper (\@data); } @out = sort { my $diff_a = $col[2] - $a->[1]; $diff_a *= -1 if $diff_a < 0; my $diff_b = $col[2] - $b->[1]; $diff_b *= -1 if $diff_b < 0; $diff_a <=> $diff_b; } @out; print Dumper (\@out); push @results, $out[0]->[2]; #print Dumper (\@results); #}
In reply to Re^14: Combining 3 files
by garyboyd
in thread Combining 3 files
by garyboyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |