in reply to read column in perl
use strict; open IN1, "file1" or die $!; open IN2, "file2" or die $!; open OUT, ">output"or die $!; my @file1; my @file2; chomp, push @file1, $_ while <IN1>; chomp, push @file2, $_ while <IN2>; close IN1; close IN2; my $i = 0;$file1[$i] .= "\t".(join "\t", split '\s', $_), $i++ for @fi +le2 ; print "$_$/" for @file1; print OUT "$_\n" for @file1; __END__ a 1 6 11 b 2 7 12 c 3 7 13 d 4 8 14 e 5 9 23
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: read column in perl
by dragonchild (Archbishop) on Mar 08, 2005 at 13:39 UTC |