One solution,see the code and result below:

$ cat 1.txt 
aaa
bbb
xxx

$ cat 2.txt 
ccc
ddd
yyy

$ cat t1.pl 
use strict;
use warnings;

open my $fh1,'1.txt' or die $!;
open my $fh2,'2.txt' or die $!;

my @out = map { chomp; $_ . ' ' . <$fh2> } <$fh1>;

close $fh1;
close $fh2;

print @out;

$ perl t1.pl 
aaa ccc
bbb ddd
xxx yyy


Hope it helps.

-----Original Message-----
>From: Onur Sirin <[EMAIL PROTECTED]>
>Sent: Jan 24, 2008 9:57 PM
>To: beginners@perl.org
>Subject: merging the columns
>
>Hi all,
>
>i have two snmp-walk commands and i want to merge its output in one file.
>For example,
>_First command's output:
>_aaa
>bbb
>xxx
>_Second command's output:
>_ccc
>ddd
>yyy
>
>How can i merge these outputs like
>aaa ccc
>bbb ddd
>xxx yyy


--
Jeff Pang  [EMAIL PROTECTED]
http://home.arcor.de/jeffpang/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to